cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
AndrewSmith84
Level: Powered On

Flow to parse from onedrive against sharepoint list

Hello, 

 

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.

 

Using: 

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
3 REPLIES 3
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. https://contoso.sharepoint.com/sites/MattWestonIntl
    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!


Proud to be a Flownaut!





Community Leader: Black Country PowerApps & Flow User Group

AndrewSmith84
Level: Powered On

Re: Flow to parse from onedrive against sharepoint list

@MattWeston365 

 

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.

AndrewSmith84
Level: Powered On

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.

 

Thankyou, 

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 202 members 4,218 guests
Please welcome our newest community members: