cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AndrewSmith84
Helper I
Helper I

Flow that parses filename to create folder issue

Hello, is there anyway I could extend on this and create a second folder.

 

So currently the solution works and creates a folder from filename FOLDER-DOCUMENT.docx, creating folder named FOLDER then moving the file to that folder.

 

However if I wanted to change the filename so it is FOLDER-SUBFOLDER-DOCUMENT.docx how would I go about this.

 

I have tried a few variations but end up spawning too many folder or none at all with errors.  I assume I need to Compose and split the string properly.  The document will then be moved into the SUBFOLDER.

 

Thankyou, 

 

Untitled.png

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks for the support.

 

I decided to create two inputs; 

 

FILENAME: FOLDER1#FOLDER2-DOCUMENT

 

1: 

first(split(triggerBody()?['Name'],'#'))

 

2: 

last(split(first(split(triggerBody()?['Name'],'-')),'#'))
 
The in create folder action I call the two Inputs as INPUT1\INPUT2 ouputs on the folder path.
 
Thankyou,

View solution in original post

2 REPLIES 2
ScottShearer
Super User III
Super User III

@AndrewSmith84 

Please see my example below that demonstrates how you might go about this.  I start with a string that I have manually entered as a proxy for the file name  - substitute the file name for my string in the first compose action.  I tested the solution below and it runs without error.

Let me know if you need additional help.

CreateFolder1.jpg

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Thanks for the support.

 

I decided to create two inputs; 

 

FILENAME: FOLDER1#FOLDER2-DOCUMENT

 

1: 

first(split(triggerBody()?['Name'],'#'))

 

2: 

last(split(first(split(triggerBody()?['Name'],'-')),'#'))
 
The in create folder action I call the two Inputs as INPUT1\INPUT2 ouputs on the folder path.
 
Thankyou,

View solution in original post

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,935)