cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sutekh666
Helper II
Helper II

Subtracting a field in one list from a field in a second list and then update

Afternoon 

 

What I want to do is to subtract the value of a field from list A from a field in list B and then update the field in list B with the new value. I'm using a Compose action, but I haven't got the syntax right. I'm pulling fields for the input in the Compose action from the Dynamic content. Where am I going wrong? Thanks in advance and Happy New Year!

 

FlowSum.png

2 REPLIES 2
Gopala_Krishna
Super User
Super User

@Sutekh666 

 

The format seems to be incorrect, you have specified the expression as sub(qty),qty) it has to be sub(qty,qty)

Bracket has to be closed after specifying both the quantities.

 

For more insights related to expressions please visit - Reference guide for functions in expressions - Azure Logic Apps | Microsoft Docs

 

If the information shared helps you, please consider giving a thumbs up 👍 and mark solution as resolved.

Thanks @Gopala_Krishna that worked, but now I'm having trouble getting the value from the secondary list. I'm using a Get Items action then trying to store the filed value Qty using Initialize variable but as soon as I try Power Automate adds a Apply to each loop and then won't let me save the Flow. Any idea how I can get the value to use in the formula? 

 

ForEachVariable.png

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (47,651)