cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Wintermere
Helper I
Helper I

File created repeatedly in SharePoint folder from multiple element array

Hi,

 

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.

 

Wintermere_0-1624774453941.png

 

appreciate any help to look at how to improve this further. Thanks.

3 REPLIES 3
Tascin
New Member

Hi Wintermere,

 

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"

Tascin
New Member

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.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,059)