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

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Create manually triggered flow for SharePoint list item to download all attachments to target folder (One Drive)

(0) ShareShare
ReportReport
Posted on by 118

Dear all, 

 

I would like to manually trigger a Power Automate flow for a selected SharePoint list item. The flow is supposed to download and transfer all attachments for this selected item to a target folder (e.g. OneDrive folder).  Furthermore each attachment should have the reference/item number included in its naming. The goal is to allow a search for all attachments linked to one reference/item number (see also example attachment -> reference number 12345678 linked to all attachments in this dataset).

 

Can somebody give me a detailed step by step instruction of how to create such a flow which can be manually triggered directly from this SharePoint Site for each selected dataset!?

 

Thank you in advance!

I have the same question (0)
  • Verified answer
    grantjenkins Profile Picture
    11,059 Moderator on at
    Re: Create manually triggered flow for SharePoint list item to download all attachments to target folder (One Drive)

    Hopefully this is what you are after. I wasn't sure if you also wanted to create a folder using the Barcode Number in addition to prefixing the file names but have done that here. If you didn't want the folder, then you can just create the files directly into your destination folder that already exists.

     

    The source list in SharePoint for this example has three attachments.

    grantjenkins_0-1666939776063.png

    grantjenkins_15-1666941181642.png

     

    And the destination folder in OneDrive is:

    grantjenkins_2-1666939849893.png

     

    The full flow is below. I'll go into each of the actions.

    grantjenkins_6-1666940453107.png

     

    For a selected item is setup for the source list in SharePoint so you can select an item and trigger the flow.

    grantjenkins_4-1666939932125.png

     

    Create new folder will create a folder in OneDrive using the fileName from the trigger.

    Since we are using the Title column for our Barcode Number, we can just use fileName from the trigger. If we wanted to get data from another column, we would need to use a separate Get item action, but no need here.

    grantjenkins_7-1666940520888.png

     

    We use Get attachments to get the attachments associated with the list item.

    grantjenkins_9-1666940641328.png

     

    Next, we setup an Apply to each to iterate through each of the attachments.

    grantjenkins_10-1666940751936.png

     

    Get attachment content gets the actual content we need to create each attachment file.

    grantjenkins_12-1666941025248.png

     

    Finally, we use Create file to create the attachment file in the folder we created earlier in OneDrive and prefix each file with the Barcode Number using fileName from the trigger.

    grantjenkins_13-1666941105649.png

     

    The final output in this example is below.

    grantjenkins_16-1666941223183.png

     

  • DirkKoch Profile Picture
    118 on at
    Re: Create manually triggered flow for SharePoint list item to download all attachments to target folder (One Drive)

    @grantjenkins Thanks a lot for your detailed reply. I followed all your steps, but I experience some issues when finally running the flow. 
    There is an error occurring when running the action "Get attachments" saying that "the item/element is not existing. It might have been deleted by another user. clientRequestId: 0982b9a6-089a-42df-b5cc-a1fa818095b3
    serviceRequestId: 921973a0-8079-5000-340d-4a21e2e85e3a???

     

    I think there is some issues with the variable "ID". Some datasets have been deleted priorily, so the ID of the dataset of which I ran the flow is 86 but in the flow is shows ID 2 (see attached Screenshot).

  • grantjenkins Profile Picture
    11,059 Moderator on at
    Re: Create manually triggered flow for SharePoint list item to download all attachments to target folder (One Drive)

    The ID you should be using for the Get attachments will be from the trigger For a selected item. It looks like you're using the ID from the Create new folder action which is why it's failing.

  • DirkKoch Profile Picture
    118 on at
    Re: Create manually triggered flow for SharePoint list item to download all attachments to target folder (One Drive)

    @grantjenkins my mistake.  Now it works just fine. Thanks a lot!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 659 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 386 Moderator

#3
chiaraalina Profile Picture

chiaraalina 290

Last 30 days Overall leaderboard