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 : pg77JcmoJgUcKXg2HhOVNJ
Power Automate - Building Flows
Answered

Copy item from library to list

Like (0) ShareShare
ReportReport
Posted on 18 Aug 2022 01:51:49 by

Hi Team,

 

Is there a way to design power automation where I want a column of list to be filled if the things are added in the document library?

 

Eg- I have a document library and If I add the folder to that library with the files in it then I would like that to add to my SharePoint list and I want the folder name to be in one column and the file name inside the folder to be in another column. and I need the file to be also attached with the list either a link to a file or file.

 

Folder name in 'Unit' column

Files name in 'Case ID' Column

Another column for attachment.

 

vsharma2_0-1660787360407.png

 

 

I have the same question (0)
  • Community Power Platform Member Profile Picture
    on 23 Aug 2022 at 04:21:07
    Re: Copy item from library to list

    Hi Wearsky, 

     

    Thank you so much for your response and that worked. 

     

    Could you please also help me with the below query?

     

    https://powerusers.microsoft.com/t5/Building-Flows/Send-reminder-email-by-taking-the-value-from-the-Column/m-p/1708125

     

    Kind regards, 

     

    V

  • Verified answer
    v-xiaochen-msft Profile Picture
    on 23 Aug 2022 at 03:19:13
    Re: Copy item from library to list

    Hi @Anonymous ,

     

    Hope you are doing well.

    We can create a string variable to collect all file extensions.

    vxiaochenmsft_0-1661224596812.png

     

    Then please use this expression 

    if(contains(variables('var'),split(slice(triggerOutputs()?['body/{FullPath}'],add(lastIndexOf(triggerOutputs()?['body/{FullPath}'],'/'),1)),'.')?[add(length(split(slice(triggerOutputs()?['body/{FullPath}'],add(lastIndexOf(triggerOutputs()?['body/{FullPath}'],'/'),1)),'.')),-1)]),triggerOutputs()?['body/{Name}'],triggerOutputs()?['body/{FilenameWithExtension}'])

    instead of 

    split(slice(triggerOutputs()?['body/{FullPath}'],add(lastIndexOf(triggerOutputs()?['body/{FullPath}'],'/'),1)),'.')?[0]

     

    Best Regards,

    Wearsky

  • MarconettiMarco Profile Picture
    3,812 Super User 2024 Season 1 on 22 Aug 2022 at 06:41:52
    Re: Copy item from library to list

    Hello @Anonymous ,

    do you want to grab the file url for each copied file?

    If yes, my solution should work, regardless the trigger.

     

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

    My blog site about Power Automate: https://powerautomatejoy.com/

    BR,

    Marco

     

     

  • Community Power Platform Member Profile Picture
    on 22 Aug 2022 at 06:36:46
    Re: Copy item from library to list

    Hi Macro,

     

    1st step says when a file is created but I'm not using it. I have a document library and I'm copying folder in it with the files and then it take the folder name as path and file name and fill the column of the list.

     

    I have this flow which worked halfly, 

    https://powerusers.microsoft.com/t5/Building-Flows/Copy-Items-from-Library-to-List/m-p/1687803#M187138

     

    The problem with that is that I have a file name with test.in.1.docx and the flow is deleting all the character after '.' but I want the flow to only delete the file extension name which is docx.

     

  • MarconettiMarco Profile Picture
    3,812 Super User 2024 Season 1 on 19 Aug 2022 at 05:42:20
    Re: Copy item from library to list

    Sure @Anonymous ,

    you can Update the item by adding the "AbsoluteUri" value, got from the "Add attachment" action, in another column:

    MarconettiMarco_0-1660887711209.png

     

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

    BR,

    Marco

     

  • Community Power Platform Member Profile Picture
    on 19 Aug 2022 at 04:18:49
    Re: Copy item from library to list

    Hi Macro, 

     

    Can I please have something that can copy the link of the file and paste it in another columns.

     

    Kind regards, 

    V

  • MarconettiMarco Profile Picture
    3,812 Super User 2024 Season 1 on 18 Aug 2022 at 07:20:23
    Re: Copy item from library to list

    Hello @Anonymous ,

    please follow these steps:

    1. Trigger=When a file is created in a folder:

    Please select the SP site and the Folder

    MarconettiMarco_0-1660806951456.png

    2. Add a SP "Get file content" action:

    Select the SP site and add the "x-ms-file-id" value got from the Trigger

    MarconettiMarco_1-1660806984974.png

    3. Add a "Create item" action:

    Select the SP site, the List and fill the Case ID and the Unit in the following way:

    MarconettiMarco_2-1660807044794.png

    4. Then, use the "Add attachment" action:

    Select:

    - ID=the Item ID grabbed from the "Create item" action;

    - File Name=the Name grabbed from the Trigger;

    - File content= the content grabbed from the "Get file content" action.

    MarconettiMarco_3-1660807113103.png

     

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

    BR,

    Marco

     

     

     

     

     

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…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Loading started
Loading complete