cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
SimonL
Level: Power Up

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
Piper
Level 8

Re: Trying to split output of variable

Hi @SimonL 

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

 

3 REPLIES 3
Piper
Level 8

Re: Trying to split output of variable

Hi @SimonL 

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

 

SimonL
Level: Power Up

Re: Trying to split output of variable

Thanks @Piper ! 

 

Stupid mistake Smiley Happy 

 

 

 

Simon

Piper
Level 8

Re: Trying to split output of variable

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

Helpful resources

Announcements
firstImage

Microsoft Flow Online Conference

Join us for a FULL day of FREE Microsoft Flow Sessions from some of the best minds in the industry!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

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

thirdImage

New Flow Community Board!

Check out the new Microsoft Flow Community Blog Topic Suggestion board!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 45 members 4,350 guests
Please welcome our newest community members: