cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Having trouble with extracting part of a string

Hi all,

 

I'm trying to extract part of a string that exists between square brackets [ ]. My function attempt is failing. Can someone help?

 

substring(triggerBody()?['title'],indexOf('[',triggerBody()?['title']),sub(indexOf(']',triggerBody()?['title']),indexOf('[',triggerBody()?['title'])))

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Having trouble with extracting part of a string

Hi @samuelstevenson,

 

Could you please share more details about the string that you mentioned and want to extract part of a string from?

 

Do you have a String such as [1234], and you want to get the 1234 in the string inside the []?

If yes, please refer to screenshot below to create the flow:

Capture.PNG

 

The expresion in the Condition 2 as below:

first(split(last(split(string(outputs('Compose')),'[')),']'))

The flow would run successfully as below:

Capture.PNG

 

 

Best regards,

Alice

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Having trouble with extracting part of a string

Hi @samuelstevenson,

 

Could you please share more details about the string that you mentioned and want to extract part of a string from?

 

Do you have a String such as [1234], and you want to get the 1234 in the string inside the []?

If yes, please refer to screenshot below to create the flow:

Capture.PNG

 

The expresion in the Condition 2 as below:

first(split(last(split(string(outputs('Compose')),'[')),']'))

The flow would run successfully as below:

Capture.PNG

 

 

Best regards,

Alice

View solution in original post

Highlighted
Regular Visitor

Re: Having trouble with extracting part of a string

Hi Alice,

 

Thanks! This worked.

 

If you wouldn't mind, could you please explain why:

  1. My solution didn't work
  2. Your solution does?

Trying to learn from my mistakes. 🙂

 

Thanks.

Helpful resources

Announcements
firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Users online (10,262)