Showing results for 
Search instead for 
Did you mean: 
Helper I
Helper I

Flow to parse from onedrive against sharepoint list



So my current flow waits for a file with a specific filename to be dropped into OneDrive; 


Filename: OPNO - DOCNAME.docx


The flow parses the filename to retrieve OPNO then creates a folder in a static sharepoint doc library and then moves the file to that folder.



first(split(triggerBody()?['Name'],' - '))
I want to change this but really struggling; 
Lets say we have 100 customers and I have a sharepoint list that has columns Customer Name, SharepointURL and UniqueID, where SharepointURL is fille with each of the customers own sharepoints sites in this format;
We have a 3rd party tool that now creates a folder in OneDrive named with a unique ID which we have mapped in the sharepoint list so we know who the customer is, I want the flow to be able to see that a folder has been created then parse the folder name and lookup the sharepoint list to then retrieve the Sharepoint URL then parse the file in that folder to create a folder inside the sharepoint site and drop the document there then delete the folder and contents from OneDrive ready for the next one.
I understand this is difficult so asking for your help.  Thanks
Super User
Super User

Re: Flow to parse from onedrive against sharepoint list

HI @AndrewSmith84 , I think the final solution for this will be fairly straight forward, but I just want to make sure that I understand your requirements before I dive into an explanation. Please confirm if this is right:


  1. 1. A File is saved into OneDrive and has a naming convention including a number and a document name e.g. MW001 - Proposal.docx
  2. When the file is being processed, I will take the ID in the document, and find where the documents are to be stored based on a list which contains:
    1. Unique ID - Question: Where is this coming from at the moment?
    2. Customer Name e.g. MattWeston365 International
    3. URL to a customer specific SharePoint site e.g.
    4. Check that a Folder for the Op Number has been created: e.g. /Sites/MattWestonIntl/Shared Documents/MW001
    5. If the Folder Exists, Move the File to this folder
    6. If the Folder Does Not Exist: Create the Folder and then move the File?

Am I on the right lines with this?


Did my reply help? Please give it a thumbs up.
Did I answer your question? Please mark my post as a solution!
If you liked my response, please consider giving it a thumbs up. THANKS!

Proud to be a Flownaut!

Community Leader: Black Country PowerApps & Flow User Group

Helper I
Helper I

Re: Flow to parse from onedrive against sharepoint list



Hi, thanks for replying thats almost right.


The current flow in place was the initial design request, that design has now changed but the current design is as follows;


1: Document with specific naming is dropped into OneDrive labelled OPNO - DOCNAME

2: The flow then parses that filename looking for " - " and taking the text to the left (OPNO) and then creates a folder in a specified sharepoint site labelled "OPNO" then drops the file in there.


The new design request is as follows; 


1: A folder with a unique ID is dropped into onedrive, this unique ID is already pre-mapped to a sharepoint list that has two columns, Sharepoint URL as you stated below and the corresponding unique ID. (Sharepoint list is in some master site, it won't reside in each customer site).


2: The flow should detect the folder creation in onedrive then parse the folder name and map it back to the sharepoint list to retrieve the sharepoint url for the customer.


3: The flow will then proceed to the original design and parse the filename then create a folder in the shared documents location of that site and drop in the file.


Thankyou very much.

Helper I
Helper I

Re: Flow to parse from onedrive against sharepoint list

@MattWeston365 if parsing a folder name in OneDrive for Business is not supported by Flow currently then we could add it to the original design part but filename being; 


(UniqueID)" - "(OPNO)" - "(DOCNAME).docx


Therefore the flow will see the file dropping into OneDrive, firstly parse the UniqueID and match that to sharepoint list to find the sharepoint site, then parse the OPNO field and then create a folder in the shared docs of that site and finally paste in the file but if possible cleanup the filename so it only contains the OPNO - DOCNAME.docx and delete the file from OneDrive.



Helpful resources


Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021


Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!


New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!


Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (10,554)