cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Trying to split output of variable

Hi, 

 

I'm trying to split the outcome of my variable which I get via (body('Get_existing_items_from_Savings_Projects_list')?['Value']?[1]?['Project_x0020_ID']). The outcome of this is 19-81.

 

Now I want to edit my expression so the outcome is 81. For that I added last(split(...),'-')

So my expression looks like this now: last(split(body('Get_existing_items_from_Savings_Projects_list')?['Value']?[1]?['Project_x0020_ID']),'-') 

 

But this function is not working.

InvalidTemplate. Unable to process template language expressions in action 'Initialize_variable_varLastID' inputs at line '1' and column '2561': 'The template language function 'split' expects two parameters: the string to split as the first parameter, the separator as the second parameter. The function was invoked with '1' parameter(s). Please see https://aka.ms/logicexpressions#split for usage details.'.
 

 

 

Anyone who can help me with this issue?

 

 

 

Thanks in advance!

Simon

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Resolver II
Resolver II

Re: Trying to split output of variable

Hi @Anonymous 

Looks like a misplaced parenthesis.

 

Yours: last(split(body('Get_existing_items_from_Savings_Projects_list')?['Value']?[1]?['Project_x0020_ID']),'-')

Moved parenthesis: last(split(body('Get_existing_items_from_Savings_Projects_list')?['Value']?[1]?['Project_x0020_ID'],'-'))

Give that a try.

Hope that helps,

Piper

 

View solution in original post

3 REPLIES 3
Highlighted
Resolver II
Resolver II

Re: Trying to split output of variable

Hi @Anonymous 

Looks like a misplaced parenthesis.

 

Yours: last(split(body('Get_existing_items_from_Savings_Projects_list')?['Value']?[1]?['Project_x0020_ID']),'-')

Moved parenthesis: last(split(body('Get_existing_items_from_Savings_Projects_list')?['Value']?[1]?['Project_x0020_ID'],'-'))

Give that a try.

Hope that helps,

Piper

 

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Trying to split output of variable

Thanks @Piper ! 

 

Stupid mistake 🙂 

 

 

 

Simon

Highlighted
Resolver II
Resolver II

Re: Trying to split output of variable

You're welcome @Anonymous we all need a second set of eyes sometimes.

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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!

Top Solution Authors
Top Kudoed Authors
Users online (7,698)