my flow involve get items from SharePoint and populate a word template. It has set to be dynamically filled based on how many items are fetched using append to array function. Flow worked well until the part where the word doc is required to be converted to PDF. The create file (SharePoint) basically attempted to create 4 different files for each "get items" value (I have 4 elements in this particular array) and failed after the first element are populated and created because file name already existed for 2nd element onwards . Populate word document action in previous step worked as intended - A single word doc with repeating content filled with value from append array and using first() to fill the word doc.
appreciate any help to look at how to improve this further. Thanks.
as far as I understand you intend to have one word document populated of four different SharePoint files, correct?
As far as I can see you put the population of the word document into the apply to each -action of the sharepoint file for which is will be populated 4 times. The error would make sense if it it is not allowed to have 4 documents with the same name.
What happens if you put the the populate document out of the "Apply to Each" action and insert the array in there?
Yes, i need only a single file, populated dynamically by "get items". The word doc are generated successfully as expected however the create file action in SharePoint intend to create multiple copies of it with each copy only contain the value of a single element of the array.
I couldn't select the file content when i tried to use append array outside of the "apply each"
Would you mind showing what exactly you try to populate in the word document? Right now, since "Create file", "Convert file", and "Create file 2", are in the same loop, they will be created 4 times (if those are 4 times).
In order to stop creating multiple files, you either could add a condition which checks if the file name already exists and skips the actions afterwards,
or populate the arrays in the loop and the drop out of the Apply to Each loop since the look is based on the items.
Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.
Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.
The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.