cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Manipulating values in Actions

Is possible for me to add / subtract values based on the certain condition e.g. if A = True, Stock = Stock - 1?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Helper I
Helper I

Re: Manipulating values in Actions

I managed to solve this through: 

 

@sub(item()?['NumberInStock'],1)

 

I wish it was simpler.    First XSLT, CAML and now yet another language to learn.

View solution in original post

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: Manipulating values in Actions

Hi @smerchant,

 

Yes, that's possible.

We could take use of condition to check the certain condition, then use Compose Action to do the calculation.

Add a condition to a flow

And:

Compose string variables

Under Compose Action, we could take use of Workflow Definition Language to perform the corresponding calculation, check the article below for more details:

Workflow Definition Language schema for Azure Logic Apps

If you need any further assistance on this, please post back (better with the flow details).

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Helper I
Helper I

Re: Manipulating values in Actions

Thank you this is very useful.  However, I can't get this to work.  

 

INPUT

"sub(Number In Stock× ,1) " 

 

When I do this, "Hello, DisplayName" it worked, but sub or add doesn't work.  

 

When I assigned output to a field (number or string I tried both) I get this error:

 

Cannot convert a primitive value to the expected type 'Edm.Double'. See the inner exception for more details.

 

Highlighted
Helper I
Helper I

Re: Manipulating values in Actions

I managed to solve this through: 

 

@sub(item()?['NumberInStock'],1)

 

I wish it was simpler.    First XSLT, CAML and now yet another language to learn.

View solution in original post

Highlighted

Re: Manipulating values in Actions

I think I am uing the same exact syntax (from a tigger item) but I keep getting the same error:

 

Syntax:  "@add(@{triggerBody()?['7: Hour']},3)",

Errror:

 

Not sure what I am doing wrong here

 The template validation failed: 'The template action 'Compose_3' at line '1' and column '109720' is not valid: "The template language expression 'add(@{triggerBody()?['7: Hour']},12)' is not valid:

Helpful resources

Announcements
firstImage

Now Live: 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!

Top Solution Authors
Users online (10,206)