cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Applications
Helper IV
Helper IV

Patching to a SharePoint List but Filtering to a Specific Item and Calculating Values, Inventory Management

I'm trying to use PowerApps to manage my inventory for product ordering, delivery, and restocking, but I'm not sure how to accomplish this in PowerApps.

I have two SharePoint lists I use, one is for pulling in the order information ("Order Information") and the other is referencing the inventory overall ("Inventory Information").

At the moment I have a form for submitting the status change for an order to the order information SP list, but I need it to also update the inventory overall list with the new amount once the item is delivered.

 

I need it to filter the inventory overall list to match only the item that it being updated, and then either subtract (delivery) or add (restock) to that item. Does anyone know how I can manage this?

 

Here are some screenshots as well:

 

Order information list:

Applications_0-1660155247573.png

 

 

Inventory overall list:

Applications_1-1660155247550.png

 

 

The PowerApp:

Applications_2-1660155247393.png

 

 

So I need the formula to filter the 2nd list based on if the text in the ordered item of the PowerApp screen matches and then update the 2nd lists quantities. Hope this helps provide clarity, thanks!

 

2 REPLIES 2
Applications
Helper IV
Helper IV

Anyone have any thoughts on how to achieve this? Still looking for a response. Thank you!

gabibalaban
Dual Super User
Dual Super User

@Applications ,

From what I understand, you use a form in Edit FormMode with DataSource set on "Order Information" list to gather and save infos about an order. 

After that, you need to use the OnSuccess() property of the form. 

You can update the data using something like:

With(
{
   item:Lookup('Inventory Information', ItemName =  YourForm.LastSubmit.OrderedItem)
},
    Patch(
       'Inventory Information',
       item,
       {
         Stock:item.Stock-YourForm.LastSubmit.Quantity
       }
)

 I cannot find where you keep info about the type of operation restock-delivery and also I can't see the name of your columns.

 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,464)