cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ryanbennett
Regular Visitor

Subtracting value of one cell from a value of a cell in another sharepoint list

I am trying to update my inventory qty in list 'Cart Items" by subtracting the value from a cell in list  'Shop Cart Ordered Items' and I am not sure how to do so in Power Automate.  

 

Basically if the Item ID matches between lists when a row is created in 'Shop Cart Ordered Items', then the qty in 'Cart Items' will be updated to subtract the 'qty' ordered in 'Shop Cart Ordered Items'.

 

 

3 REPLIES 3
v-chenzhi
Community Support
Community Support

Hi @ryanbennett ,

 

Do you want to update the ListB when a new item create in ListA?

Could you please show me about your SharePoint?

I have a test on my side for your reference, please try the following workaround.

I create two lists like this:

vchenzhi_0-1640245300229.png

vchenzhi_1-1640245329702.png

vchenzhi_2-1640245400486.png

vchenzhi_3-1640245482077.png

Here is the expression:

sub(items('Apply_to_each')?['TheNumber'],triggerOutputs()?['body/TheNumber'])

When I create this record in ListA.

vchenzhi_4-1640245559636.png

The record of ListB is updated to:

vchenzhi_5-1640245682171.png

 

 

Best Regards,

Zhi Chen

 

 

 

 

 

 

See my lists below.  When an item is created, I want to subtract the Qty value from list 'Shop Cart Ordered Items' from the Inventory QTY value in list 'List Items'

 

ryanbennett_0-1640887512636.png

ryanbennett_1-1640887570169.png

 

 

With the formula in the example I am getting an error for null values

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (1,454)