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
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (1,388)