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 / Sharepoint Online Copy...
Power Automate
Unanswered

Sharepoint Online Copy attachments from a list into a document library that is defined with the list

(0) ShareShare
ReportReport
Posted on by 125

Morning,

 

I have been struggling with this particular quandary and I know i am close to the solution but could use some help.

 

I have a sharepoint list set up that allows users to upload documents to it. The sharepoint list has a couple of flows attached to it. The first of which looks to see if one of the list fields "Document Library URL" is populated, if not it will go off and create a document library and place the URL in that field.

 

The next flow i have looks to see if any attachments have been added to that list item and then copies them to that document library and deletes them from the list, this works well for the document libraries created by the first flow, as i control the naming convention and know the top level file path, as the document libraries are all created in the same place. 

 

The issue i am facing is one where a document library already exists. What i want to be able to do is send the document to the URL identified in the list field. However using create file against that dynamic content throws an error my current flow looks thus:

 

Jezter12_0-1645003621745.png

One of the options i looked at was moving the attachment content to a holding library then using a move files command to move it to it's destination, but that hit a similar issue around the dynamic url. 

 

Does anyone have any clues? Please.

Categories:
I have the same question (0)
  • v-jefferni Profile Picture
    on at

    Hi @Jezter12 ,

     

    Could you please share more details of the Library URL column values?

     

    I made a simple flow to test with the folder path parameter:

    vjefferni_0-1645175014578.png

    So the custom value should only be /LibraryName/FolderName . If you were saving the folders' hyperlink to this URL column, then I think you will need a get files (properties only) action to filter on the comparison of link and the stored URL and use the returned folder path value in create file action.

     

    Hope this helps.

     

    Best regards,

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

     

     

  • Jezter12 Profile Picture
    125 on at

    So the library url flow is a complicated beast, but i will attempt to simplify.

     

    When an item is added to the source list a flow creates the document library based upon the name of the item added to the list, so a field in the sharepoint list is called "Initiative name". Now, because this is a free text field, it also strips out any special characters and inserts %20 in any spaces. So I have the below flow that constructs the document library name to append to the end of a URL, this gives the path and document library name. But not folder as i am trying to get people not to use folders as i want to be be able to create standard views and reporting at the top level of these libraries.

     

    The construction of the library name for the URL is covered below.

    Jezter12_0-1645450760718.png

    I then have a compose function that will generate the URL that directs to that document library. Using the output from the Library URL replace expression.

     

    Jezter12_1-1645450879240.png

    So for my constructed url all i need to do is pull in the top level folder for that document library. And i would do the same for any library that is added by the end user.

     

    Edit, so i would be expecting the end user to be copying and pasting the url into that sharepoint field from a web browser so the url would include the document library and/or the folder where they want to deposit the items. Its just how do I extract that element of the url and get them to populate as dynamic content, i think.

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard