I have a flow that populates a MS Word template that includes 2 photo content controls so that Power Automate can populate with photos from a SharePoint folder. The photos all follow a naming convention. (i.e. Photo1, Photo2).
The flow executes successfully when there are 2 photos named in accordance with the naming convention in the SharePoint folder however the flow fails if there are fewer than 2 photos in accordance with naming convention (i.e. no photos or just Photo1 or just Photo2) . It appears the failed flow is due to the "file not found" (which makes sense).
Is it possible to have the flow ignore the "file not found" error and populate what it can based on the files that are in the SharePoint folder?
- If no files match the photo naming convention, do not populate any photos and create document without flow failing
- If only 1 file matches the photo naming convention, just populate the 1 photo and create document without flow failing
- If 2 files match the photo naming convention, populate both photos (already successful with current flow)
A couple notes:
- I am using a "Get File Content" step for each photo - Photo1 & Photo2
- The file identifier for "Get File Content" is the file path to Photo1 & Photo2 respectively
- I anticipate using dynamic content to create variable file paths but the image files will be named consistently
- I am trying to understand this at a basic level before scaling it up
