cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Create file in OneDrive dynamic folder

This should be a simple process.  We are generating documents in a SharePoint library and walking through a multistep approval process - All Good.  What I need is for the document, when marked as Approved, to be converted to PDF and copied to OneDrive for Business in the same folder hierarchy.

For example - library at https://sharepointsite.com/sites/sitename/Shared%20Documents/Project A/Report/ has a report that, when approved should be copied to https://ondrivefolderstructure/Project A/Report/.

 

Now the triggering, copying and converting I can do. 

 

How do I get the dynamic folder subpath - /Project A/Report/ from the SharePoint file and replicate it into OneDrive?  There are many projects and many subfolders but the struture should be replicated in two locations.  Where is the string manipulation subset of Flow?

 

Thoughts?

 

OneDayAtATime

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Create file in OneDrive dynamic folder

Hi @Anonymous,

 

I have made a test on my side and would offer you the method refer to the path.

 

Please refer to screenshot below to create the flow:

 

Capture.PNG

 

The expression in the Compose 2 as below:

first(skip(split(outputs('Compose'),first(split(outputs('Compose'),'/'))),1))

  

Note:

1.Choose the "Folder Path" dynamic content of the trigger in the Compose field.

2.The expression in the Compose 2 as below:

 

first(skip(split(outputs('Compose'),first(split(outputs('Compose'),'/'))),1))

  

When a file is created in the link https://sharepointsite.com/sites/sitename/Shared%20Documents/Project A/Report/, the flow would run successfully as below:

Capture.PNG

 

 

Please let me know if your problem could be solved.

 

Best regards,

Alice

 

 

 

 

 

View solution in original post

3 REPLIES 3
Highlighted
Community Support
Community Support

Re: Create file in OneDrive dynamic folder

Hi @Anonymous,

 

I have made a test on my side and would offer you the method refer to the path.

 

Please refer to screenshot below to create the flow:

 

Capture.PNG

 

The expression in the Compose 2 as below:

first(skip(split(outputs('Compose'),first(split(outputs('Compose'),'/'))),1))

  

Note:

1.Choose the "Folder Path" dynamic content of the trigger in the Compose field.

2.The expression in the Compose 2 as below:

 

first(skip(split(outputs('Compose'),first(split(outputs('Compose'),'/'))),1))

  

When a file is created in the link https://sharepointsite.com/sites/sitename/Shared%20Documents/Project A/Report/, the flow would run successfully as below:

Capture.PNG

 

 

Please let me know if your problem could be solved.

 

Best regards,

Alice

 

 

 

 

 

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Create file in OneDrive dynamic folder

Alice

 

Many thanks for your efforts.  I haven't had a chance to check this out but it looks perfectly reasonable.  Thank you.

Highlighted
Frequent Visitor

Re: Create file in OneDrive dynamic folder

Helpful resources

Announcements
secondImage

August 2020 CYST Winners!

Check out the winners of the recent 'Can You Solve These?' community challenge!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

thirdimage

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 (3,971)