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-05-16T02:46:36+00:00

    Hello,

    Please forgive me but I do not understand what is meant by, "Could you check whether some file name and file content is got from the action at your side? If the output is null such as [ ], the Create file action will got no parameter to create the file and will run with failure."

    This is the error message details displayed on the flow screen.

    Error: Action 'Create_file' failed**Error Details:**Root folder is not found.

    This is the information provided after clicking the "Click to download" link for the Create File inputs and outputs.

    INPUTS: {"error": {"code": "AuthorizationFailed","message": "The authentication credentials are not valid."}}OUTPUTS:{"error": {"code": "AuthorizationFailed","message": "The authentication credentials are not valid."}}

    Also, after correcting the Append to Array Variable Parse JSON name, I noticed the creation of an Apply to Each 5, which I don't believe was there previously (seen in the previous screenshot). Not sure if that matters but it seems to have auto-updated within Power Automate after the correction.

    Thanks

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2024-05-16T06:41:11+00:00

    Dear Lissa,

    Thanks for your updates and kindness.

    It seems that the root folder isn't found by the flow, the files can't be created in that folder. In the further error message you post here, there seems to be some connection issue with your account in the Create file action.

    It seems that you want to create the file in OneDrive for Business.

    If yes, I suggest you do the following.

    1. Click on ... on the Create file action>check whether there are some connection issue. If yes, re-verify the connection with your account.
    2. If you want the flow to create files in OneDrive for Business, use the Create file in OneDrive for Business instead of SharePoint Online to see the result.

    1. If you want to use the Create file action in SharePoint Online, please check whether you put the right site URL.

    https://contoso-my.sharepoint.com/personal/username\_contoso\_onmicrosoft\_com

    About ""Could you check whether some file name and file content is got from the action at your side? If the output is null such as [ ], the Create file action will got no parameter to create the file and will run with failure.", I mean that I want to confirm whether the output shows the content code generated from Filter array 2 in your environment.

    I'd like you expand the action and provide the screenshots of the output for our reference.

    Note: Remove any private information before uploading the screenshots.

    Thank you for your effort and time.

    Sincerely

    Cliff | Microsoft Community Moderator

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2024-05-26T16:54:11+00:00

    Thank you for that information. I've finally hit a successful flow. But there are a few problems:

    1. The naming convention of the files does not remain as they were named when uploaded to the MS Form. For whatever reason, my first and last name, along with a number, is being added to the end of the file name. The uploaded file name needs to remain as is and not be altered after submission.
    2. There is no available preview (these are image files) for the files that are added to OneDrive via the automation. If I manually add a file to the same folder, I am able to click on it and see a preview. If the file is added via the automation, I get a no available preview message. Please advise.

    Thanks

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2024-05-28T06:43:29+00:00

    Dear Lissa,

    Thanks for your updates.

    Generally, the uploaded file will be saved in the Microsoft Forms folder in OneDrive for Business and named as upload file name+_your name+extension or upload file name+_your name+number+extension.

    If you want to keep the upload file name, you may add the following expression in your flow.

    For example:

    Extract the original file name:

    substring(items('Apply_to_each')?['name'],0,indexOf(items('Apply_to_each')?['name'],'_'))

    Extract the file extension:

    substring(items('Apply_to_each')?['name'] , indexOf(items('Apply_to_each')?['name'],'.'), sub(length(items('Apply_to_each')?['name']),indexOf(items('Apply_to_each')?['name'],'.')))

    Please change the formula based on your flow environment.

    After adding the formula, the flow result is like the following.

    I check the folder and the created files and I see the preview of the files like the following.

    So what is the outcome at your side? Some related screenshots are appreciated.

    Note: Remove any private information before uploading the screenshots.

    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-05-29T01:35:13+00:00

    Thank you for that information. By stating: "Generally, the uploaded file will be saved in the Microsoft Forms folder in OneDrive for Business and named as upload file name+_your name+extension or upload file name+_your name+number+extension." Do you mean that the file name is changed because it is being added to a OneDrive account and would not be changed if it were added elsewhere, such as a departmental SharePoint document library?

    I'm trying to be clear because I will be duplicating this flow for general use. Currently, the files are being added to my OneDrive for Business while testing. When the flow operates successfully, the flow will be updated by removing the OneDrive for Business (Create file) and adding the SharePoint Create file option. Your suggestions on the most efficient way to duplicate this flow with the desired updates are welcome.

    Please advise where the formula you provided should be added as I don't understand. I have added a Next Step as shown in your screenshot but it's unclear where I'm supposed to paste the formula. Your screenshot does not show this.

    Thanks.

    Was this answer helpful?

    0 comments No comments