How to add the values of two entity parameters?

0
I have an entity with 2 parameters – “CurrentStock” and “AddToStock”, of type Integer. When I click on a button it should call a microflow, that will loop through all the records of this entity and will add the value of both parameters (“CurrentStock” + “AddToStoc”) and set it as a new “CurrentStock” value. I tried to use loop for it, but I’m always getting an error or nothing happens. It should be a simple operation, I would be grateful for the example of how this microflow should look like.
asked
3 answers
0

Isn’t it simple like:

  1. Adding a change activity for the entity in SAVE microflow. Entity will already be passed to this
  2. set the attribute of CurrentStock with value $Entity/CurrentStock + $Entity/AddToStock
  3. not sure why you need to loop unless if you want to process multiple items.
  4. NOTE: you can also use before commit events if this is always the case for this entity and attribute. But logic should remain same.
  5. If you are getting an error, please post error with screen shots, so you get the help needed.

 

Posting an example:

answered
0

Would be grateful for the support on this, thank you in advance!

answered
0

Hi Maxim,

Your flow could look something like this:

(Right click and save image as to see whole flow)

If you're getting errors, this is possibly because one of the 2 attributes is empty. So add some empty checks in or before your change action that if one or both are empty, your currentstock will be 0 or stay the same. 

 

 

answered