cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nvrhughes
Level: Powered On

Substring at Index

I have a Flow that is quering an ID from a SQL DB and sending it back into PowerApps. 

 

This is what Flow is returning to Power Apps: ResultSets: {"Table1":[{"Id":"06f74153-d28d-4c40-9955-a7975b1f66eb"}]}

I was able to use the substring and indexOf functions to get it to this: :"06f74153-d28d-4c40-9955-a7975b1f66eb

 

The only thing left to do is get rid of the first 2 characters in my result --> :"

 

Here is my logic: substring(string(outputs('Compose')),indexOf(string(body('Execute_a_SQL_query')),':"'),38)

 

I know I need to subtract 2 characters from my index, but cant seem to find the correct syntax.

 

flowGUID.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Substring at Index

You need to add 2 to the index that you get from the indexof function (and remove 2 from the length of the substring):

substring(
    string(outputs('Compose')),
    add(
        indexOf(string(body('Execute_a_SQL_query')),':"'),
        2),
    36)

This should get you the GUID that you want. Hope this helps!

2 REPLIES 2
PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Substring at Index

You need to add 2 to the index that you get from the indexof function (and remove 2 from the length of the substring):

substring(
    string(outputs('Compose')),
    add(
        indexOf(string(body('Execute_a_SQL_query')),':"'),
        2),
    36)

This should get you the GUID that you want. Hope this helps!

Community Support Team
Community Support Team

Re: Substring at Index

Hi @nvrhughes 

 

Do you test with @CarlosFigueira 's suggestion, if it works ok.

Please accept it as solution.

 

Best Regards.

Yumia

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

Follow PowerApps on Twitter

Stay Up-to-Date by following PowerApps on Twitter

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 45 members 4,309 guests
Please welcome our newest community members: