cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Piper
Level 8

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

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

Anonymous
Not applicable

Re: Trying to split output of variable

Thanks @Piper ! 

 

Stupid mistake 🙂 

 

 

 

Simon

Highlighted
Piper
Level 8

Re: Trying to split output of variable

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

Helpful resources

Announcements
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!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

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 Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,665)