How to auto separate MS Lists uploads into separate Sharepoint folders using Power Automate?

Anonymous
2024-04-09T20:38:05+00:00

Hello,

Just realized that MS Lists only allows 1 column for attachments (though allowing multiple attachments). The problem is, I was trying to create multiple columns so the attachments can be added by category.

Since I can't categorize multiple columns, I need to be able to separate the attachments into categorized folders once they are uploaded but I want to do this automatically.

How do I use Power Automate to grab the attachments and place each file in separate SharePoint folders? Thanks!

Lissa

Microsoft 365 and Office | Install, redeem, activate | For business | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

54 answers

Sort by: Oldest
  1. Anonymous
    2024-04-19T16:15:31+00:00

    Thank you so much! I'm sorry but I'm a bit confused (as I mentioned, I'm very new to Power Automate). Below is what I have so far (thanks to visuals from YouTube). With this, I was able to get the attachments from Microsoft Forms to Microsoft Lists. I'm not clear on what steps to add next to get the attachments from Microsoft List to specific folders on SharePoint according to the file names.

    I know you've provided steps in the previous response but I'm confused about how to add it to what I've already created. Could you kindly provide another screenshot to help?

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2024-04-20T06:30:37+00:00

    Dear Lissa,

    Thanks for your updates and kindness.

    Here is an example flow for your reference.

    Form

    Flow Details

    Append to array variable

    {

    "Name": "@{items('Apply_to_each')['name']}",

    "Content": @{body('Get_file_content')}

    }

    Filter Array:

    replace(item()?['Name'], '_', ' ') contains Category Blue

    Welcome to share any updates at your convenience.

    Thank you for your effort and time.

    Sincerely

    Cliff | Microsoft Community Moderator

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2024-04-22T20:49:46+00:00

    Hello,

    Thank you so much for providing this detailed response. I sincerely appreciate it. As mentioned, I'm new to Power Automate (meaning this is my first time using it). With that, please forgive me as I need a more detailed explanation.

    I did not understand how to get the code for the schema. It took me a while but I eventually figured it out.

    I was able to follow along with the information provided in the previous response but got lost at the Append to Array Variable step:

    1. I do not understand what is being relayed with the code below. What am I supposed to do with it? Am I supposed to change some of the values? Please advise. Append to array variable { "Name": "@{items('Apply_to_each')['name']}", "Content": @{body('Get_file_content')} } Filter Array: replace(item()?['Name'], '_', ' ') contains Category Blue
    2. When I try to enter the values as shown in the screenshot, the OneNote body option is not available to me. I'm only able to select from 3 body types, none of which are related to OneNote. Power Automate is also auto-populating an Apply to Each 2. Not sure why or if that is problematic.

    I have not gotten to the final screenshot but I am also unclear what is being communicated with the red text. Is it an explanation of something or code that I need to include somewhere?

    I do hope you can be so kind as to provide a thorough explanation to help me understand your direction and accomplish this task.

    Thanks!

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2024-04-23T07:03:40+00:00

    Dear Lissa,

    Thanks for your updates.

    I create the flow based on the example of your previous posts.

    Move the following attachments to the folder Category Blue automatically.

    1. Category_Blue_Jane
    2. Category_Blue_Jon
    3. Category_Blue_Jen

    The Initialize Variable action can create the file array if you have uploaded multiple attachments to the form. No matter single attachment or the multiple attachments, the Append to array variable can create an array for all uploaded files.

    As you have got how to parse JSON, the name and the id parameter of the attachments should be extracted.

    As the normal form attachments are saved in OneDrive for Business, you can get the file content based on the id got from Parse JSON.

    After got the file content, you can create an array like what I showed above for creating file in the library folder.

    {

    "Name": "@{items('Apply_to_each')['name']}",

    "Content": @{body('Get_file_content')}

    }

    As not all the attachments meet the condition Category Blue, you need to use Filter Array from the created array to filter the matched files.

    As there is "_" in the file name, replace it with a space is necessary by using replace(item()?['Name'], '_', ' ').

    For the last step, you need to type items('Apply_to_each_2')?['Name'] in File Name and items('Apply_to_each_2')?['Content'] in File Content.

    Welcome to share any updates at your convenience.

    Thank you for your effort and time.

    Sincerely

    Cliff | Microsoft Community Moderator

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2024-04-23T18:28:12+00:00

    Thank you so much for your patience with me. Again, I've never used Power Automate before.

    I'm trying to find out what I'm supposed to do with the code below. Am I supposed to copy and paste it somewhere in the flow for it to work? You've provided the code in your response but I don't see it anywhere in your screenshots so I don't understand what I'm supposed to do with it.

    {

    "Name": "@{items('Apply_to_each')['name']}",

    "Content": @{body('Get_file_content')}

    }

    The same goes for the codes items('Apply_to_each_2')?['Name'] and items('Apply_to_each_2')?['Content']. What am I supposed to do with it?

    Am I supposed to paste items('Apply_to_each_2')?['Name'] in the **** File Name field? **** Am I supposed to paste items('Apply_to_each_2')?['Content'] in the File Content field?

    Please tell me exactly what I need to do here because I've never used Power Automate before and I don't understand all the jargon (though it may make more sense as time goes by, but right now, I don't comprehend). I can definitely accomplish this with your help. Thanks!

    Was this answer helpful?

    0 comments No comments