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.
Isn’t it simple like:
Adding a change activity for the entity in SAVE microflow. Entity will already be passed to this
set the attribute of CurrentStock with value $Entity/CurrentStock + $Entity/AddToStock
not sure why you need to loop unless if you want to process multiple items.
NOTE: you can also use before commit events if this is always the case for this entity and attribute. But logic should remain same.
If you are getting an error, please post error with screen shots, so you get the help needed.
Posting an example:
Would be grateful for the support on this, thank you in advance!
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.