cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Toshi_H1989
Frequent Visitor

Extract Strings

Currently Im using powerautomate and  I want to extract 'PUN' from follwing string.

how do I extract data with function of power automate..

 

WH_GGN-PUN-SER-AFS-

the format is ooo-ooo-ooo-ooo-

 

1 REPLY 1
ekarim2020
Community Champion
Community Champion

An expression using the split() function can extract the text. We can split at the '-' character.

2021-11-17_12-10-36.png

 

The split() function returns an array of values:

2021-11-17_12-08-34.png

 We want "PUN" which is item 1 - based on the format  xxxx-XXXX-xxx-... Numbering starts at 0 for array items:

2021-11-17_12-03-17.png

Here is an example flow:

2021-11-17_11-59-53.png

The following expression using the slit() function will extract the second block of text:

split(outputs('Compose'),'-')[1]

 


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

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,259)