cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
treddfw
New Member

parse long input string with multiple delimiters

I've reviewed the documentation, but still stuck. Any help for this newbie greatly appreciated.

 

In the Power Automate Desktop, I've added a "Display input Dialog". The user will input a File Name with full path here.

i.e. \\server_name\Sales\Division 4\East Coast\NJ\Conference Agenda.pdf

 

I've added a "Parse Text" action to the flow to search for each occurrence of "\".   The default Positions variable returns an array of

 

#  Item

0  0

1  1

2 12

3 18

etc.

 

I need to put into 3 variables the: 1. File Path  2. File Name  3. File Extension

 

I'm stuck on how to access the last value of Item in the %Positions% variable.

Thanks!

 

1 ACCEPTED SOLUTION

Accepted Solutions
VJR
Memorable Member
Memorable Member

Hi @treddfw 

 

If you Positions variable looks like this..

 

VJR_0-1638269694848.png

Then you need to use %Positions[Positions.Count - 1]%

You need to do minus 1 because it starts from 0.

This will display the last element as below.

 

VJR_1-1638269772532.png

 

I see that we are already interacting on the other thread for the PAD actions here.

 

 

View solution in original post

2 REPLIES 2
VJR
Memorable Member
Memorable Member

Hi @treddfw 

 

If you Positions variable looks like this..

 

VJR_0-1638269694848.png

Then you need to use %Positions[Positions.Count - 1]%

You need to do minus 1 because it starts from 0.

This will display the last element as below.

 

VJR_1-1638269772532.png

 

I see that we are already interacting on the other thread for the PAD actions here.

 

 

View solution in original post

Thanks for the solution! My next PAD project will need this!

Helpful resources

Announcements
Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Users online (1,654)