cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Harry_G
Kudo Kingpin
Kudo Kingpin

extract substring using compose

I have string have value "[113] this is testing string". i need to convert it "this is testing string". I tried compose action with substring using Indexof. But unfortunately it doesn't work for me. Any help woulf be appreciated 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
v-yuazh-msft
Community Support
Community Support

Hi @Harry_G,

 

I have made a test on my side, please refer to screenshot below to create the flow:

Capture.PNG

 

The expression in the Compose 2 as below:

substring(outputs('Compose'),6,22)

And you could also enter the expression below in the Compose 2:

last(split(outputs('Compose'),'[113] '))

 

The flow would run successfully as below:

Capture.PNG

 

 

 

Best regards,

Alice

View solution in original post

6 REPLIES 6
v-yuazh-msft
Community Support
Community Support

Hi @Harry_G,

 

I have made a test on my side, please refer to screenshot below to create the flow:

Capture.PNG

 

The expression in the Compose 2 as below:

substring(outputs('Compose'),6,22)

And you could also enter the expression below in the Compose 2:

last(split(outputs('Compose'),'[113] '))

 

The flow would run successfully as below:

Capture.PNG

 

 

 

Best regards,

Alice

View solution in original post

Thanks @v-yuazh-msft. it working like a charm :).

Thank you but you have manually mentioned the 6 and 22 as number for index and characters . How to get it automatically or in other words what if we aren't sure about what those numbers could be?

How would you go about this if you wanted the values between << and >>

 

i.e.  <<just this text>>  would return  just this text

First(Split(Last(Split("<<just this text>>", "<<")), ">>")), which will first extract "just this text>>" and then "just this text".

@PSchiager   nice thanks 🙂

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (61,009)