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 / Two lists: Order + Inv...
Power Automate
Suggested Answer

Two lists: Order + Inventory, update values

(2) ShareShare
ReportReport
Posted on by 57
Hello all,
 
I'm sure this is an easy fix but I'm not sure on the best way to manage it.
I'm creating a temporary ordering and inventory system for my company and want to use two lists to do this.
 
I have created a flow that will:
  • Check when an item has been created/ modified in the Order List.
  • It will get items from the Inventory List.
  • A condition will check to see if the Status in the Order List is set to "Received"
  • A condition will check to see if the Product Name/ Product ID is the same between the Order and Inventory lists:
    • If NO, the item will be created in the Inventory List as a new Product.
    • If YES, the item in the Inventory List will be updated with the new value.
I am struggling with this last part, where the value will be updated with an increase, rather than a full change.
For example, if the Inventory List product has a Quantity of 2 and an order is made for 4, I would want the Inventory List to be updated to 6 and not overwritten with 4.
 
This is how I currently have my flow:
 
CDN media
 
Any help or advice is very much appreciated!
 
Thanks,
Tommy
 
Categories:
I have the same question (0)
  • Suggested answer
    Ravi-Prajapati Profile Picture
    416 Moderator on at
    try this
     
    add(int(items('Get_items')?['Quantity']), int(triggerOutputs()?['body/Quantity']))
     
    adjust names as per the actual internal names
  • Chriddle Profile Picture
    8,686 Super User 2026 Season 1 on at
    When you loop over the items in the inventory list (in the "Apply to each"), you never create a new item because you won't enter the loop if there is no such item ;)
  • TM-11021013-0 Profile Picture
    57 on at
    @@CU04021533-0 Thank you for the code, I've put that in and hopefully that will work once the entire Flow works.
     
    @@Chriddle Thank you for your answer but the  "Apply to each" gets automatically added every time that I work on this, so I cannot remove it. How do I work around that?
     
    Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The workflow action 'Update_item' at line '1 and column '2056' references the action 'Get_items' of type 'OpenApiConnection': only the actions of type 'foreach' are allowed to be referenced by 'repeatItems' or 'items' functions.'.'.
     
    I have changed the order to be that the first condition will check to see if the Product Name is the same (i.e. "M4*12 Screws"). If it is not the same, the second condition checks if the Status in the Order List has been set as Received; if so, Create item.
    The Update Item in Inventory List is still causing me issues with the error above. I cannot reference the Get Items to Update the items in it. But I'm not sure how to work around this.
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 801

#2
Valantis Profile Picture

Valantis 602

#3
Haque Profile Picture

Haque 581

Last 30 days Overall leaderboard