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
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,049)