web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Help subtracting a val...
Power Automate
Answered

Help subtracting a value when an item is created

(0) ShareShare
ReportReport
Posted on by 196

Hello,

Looking for help please.

I have two lists

List 1 has 2 columns, ProductID = 41, Available Stock = 100

When a new item is created in List 2, where ProductID = 41, update, Available Stock, by subtracting 1 from the existing value.

 

Any ideas please?

Thanks

 

Ross


Ross

Categories:
  • Verified answer
    v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @rosscortb ,

     

    Here is a simple way for your reference:

    1.Add "When an item is created" as trigger.

    2.Find item in list1 according to ProductID of trigger's outputs.

    3.Get ID and Stock of item in list1 and use it in Update item to subtract 1 from existing Stock.

    vmengmlimsft_0-1706062435681.png

     

     

    Best regards,

    Rimmon

     

  • rosscortb Profile Picture
    196 on at

    @v-mengmli-msft Thanks, but it didn't quite work for me.

    I've broken it down and done this to check the first part and even when I created an item where the ProductID = 41, the condition comes back false?

    rosscortb_0-1706097312455.png

     

  • rosscortb Profile Picture
    196 on at

    @v-mengmli-msft Managed to work it out, thanks. When the Available Stock hit 0, another column called Out of Stock, should be updated to input, Out of Stock. I have worked this out. Question I have is, in the scenario where loads of orders are placed around the same time, which I have test, the flow can fail, do you know a work around for that?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 321 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 271

#3
Henil Profile Picture

Henil 115

Last 30 days Overall leaderboard