Approving Photos for a SharePoint Document Library with a Flow
Use case of the week: Provide an easy way for attendees at a company function to upload photos snapped at the event for storage in a SharePoint Document Library (SPDL). Also, the images should be approved before they are added to the SPDL. If approved, additional information should be added to a custom column, Description of the image.
The solution includes a Microsoft Form and a Power Automate Flow. Here's a screenshot of the Flow steps.
领英推荐
Keep in mind, that generally, MS Form responses are stored on the "run as person's" One Drive (/Apps/Microsoft Forms/[your-form_name]/Question). With that fact in mind, a List files in folder action creates an Apply to each loop, whereas a Get file content action allows the next step, Start and wait for an approval to display the Name and the File Content in the email the approver(s) receive. Being inside the loop, each Start and wait for an approval queues up one after the other. If that's a problem, one can introduce a Child Flow that handles each photo approval asynchronously. A Condition action is applied. If a photo is approved, the SharePoint Create File action is called, then the Get file properties, the Update file properties, and finally, the One Drive for Business Delete file action is run. The One Drive for Business Delete file action is applied if a photo is rejected. Why delete the photos in the One Drive folder? The why is once the photos are processed, they are no longer needed. Leaving the photos would cause them to be picked back up the next time the Flow is triggered during the List files in folder action.