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

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
smerchant
Level: Powered On

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.

4 REPLIES 4
Highlighted
Community Support Team
Community Support Team

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.
smerchant
Level: Powered On

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.

 

smerchant
Level: Powered On

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.

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

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

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!

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: 62 members 4,872 guests
Please welcome our newest community members: