web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Saving attachments fro...
Power Automate
Unanswered

Saving attachments from Sharepoint list items to the folder

(0) ShareShare
ReportReport
Posted on by 13

Hello,

 

I've created a simple flow that saves attachments from items in Sharepoint list to the folders. Folders are created per each list item based on its name. The trigger is 'when at item is created or modified' as it happens that users are adding attachments after list item is created. The flow works great and attachments are being saved. However, the problem is that whenever the flow runs for the second or third time because list item is modified, e.g. because its status changes, the flow fails. It looks that it tries to save the attachments which are already there. Although I have create a condition which should allow file creation only for attachments which are not in the folder already, the condition always returns 'true'. Most probably, the formula in the condition is wrong.

 

I would be grateful for any help on this.

Categories:
I have the same question (0)
  • fchopo Profile Picture
    8,003 Moderator on at

    Hi @NUrniaz 

    Could you instead try with the formula:

    contains(items('apply_to_each')?['Name'],FileLeafRef)

    Using Name instead of DisplayName

    Hope that helps!
    Ferran

  • NUrniaz Profile Picture
    13 on at

    hello @fchopo ,

    thanks a lot for helping me on this.

    However, I am not sure I get you correctly, So- I tried changing 'display name' to 'name' i filter query, but that didn't help (it recovered list items name instead of files). I tried changing the formula in the condition to your suggestion contains(items('apply_to_each')?['Name'],FileLeafRef) is equal to true, but the expression seems to be incorrect (I've also tried filtering through that and didn't work). I'm not very experienced, could you please let me know more step by step what would you change in the flow?

    Thanks!

  • fchopo Profile Picture
    8,003 Moderator on at

    Hi @NUrniaz 

    In this article you will find all operators you can use as OData filters, and most important, order of parameters: OData Filter query in SharePoint Get items in Flow (sharepains.com)

     

    I did a test with the following expression (and it worked!):

    substringof('Data',FileLeafRef)

    Where Data is the word we're searching for inside name of the file.

    Hope that helps!

    Ferran

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard