cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular Visitor

Working with SharePoint item and library files

I have a flow that triggers when a file is attached to a SharePoint item. The file will then be taken using 'Get attachments' and 'Get attachment content', and a new file will then be created in a specific SharePoint library using 'Create a file'. I have a uniform naming convention to follow so whatever the original name of the file it will always be changed to said format and for multiple attachments, an index that increments is added (ex: This_File, This_File_1, This_File_2...).

The problem occurs, having this scenario as an example - when the process is done and the item is saved but I want to edit or add/attach another file in it, the file will then be renamed to This_File, saving it will overwrite the original This_File that I have in the SharePoint library. Is there any workaround on this? Can I check for the existing files in a library and compare it to the files that are being created?


Does this make sense?

Any help is appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @RH-MP ,

 

You could consider creating folders for each item in the specified list, with the ID as the Folder Name.

This way, even if the original file is overwritten, all the Attachments are saved and there is no conflict.

 

Image reference:

16.PNG

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Dual Super User III
Dual Super User III

You could use the Get Files (Properties only) action to get a list of the filenames in the folder and then check to see if the Filename you want is included in the collection.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Community Support
Community Support

Hi @RH-MP ,

 

You could consider creating folders for each item in the specified list, with the ID as the Folder Name.

This way, even if the original file is overwritten, all the Attachments are saved and there is no conflict.

 

Image reference:

16.PNG

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (66,968)