cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Hiattech
Level: Powered On

check inventory stock

I am building an app that will list the inventory of our field service techs vans. so far I have it setup so they can pull up their inventory and add or subtract items as they use things.  The next part of the app I want to use is an inventory section.  Once or twice a year, the techs have to do a full inventory of their vans and submit any differences.  I have a page created that will use the barcode scanner (if that's a good option) and then a gallery below it.  I would like the app to scan the barcode and as it scans each one, it will pull up the info from the list so the tech can verify what they scanned, and add it to an inventory list (this would need to be clearable when they start a new inventory). if multiple items are scanned, it should not add another entry, but increase the quantity listed for that item.  Once done, the tech can then go into the list and do a comparison if he is short or over on items. 

 

I'm fairly new to PowerApps but I have been trying my best to learn all I can.  I'm not sure really where to start or if there are any good videos/documents that can help jump start me.  Here's basically what I have for the inventory page.  Right now it's listing all the items in the list which I don't want it to do.  Only the items that have been scanned.  But, like I said, I'm not really sure where to start.  I'm thinking I need to create a collection though . . . 

 

Inventory App.JPG

3 REPLIES 3
Community Support Team
Community Support Team

Re: check inventory stock

Hi @Hiattech,

Could you please share a bit more about your SP list?

Do you add a column within your SP list to store barcode value of the corresponding product?

I suppose that you have added a column in your SP list to store the barcode vlaue of the corresponding product, is it true?

If you only want to display the records within the Gallery based on the barcode value the Barcode control scanned, I have made a test on my side, please take a try with the following workaround:2.JPG

Set the Items property of the Gallery control (Gallery1) to following:

 

If(!IsBlank(Barcode1.Text),Filter(RecordsCollection, Barcode = Barcode1.Text))

On your side, you should type following:

 

If(!IsBlank(Barcode1.Text),Filter('YourSPList', Barcode = Barcode1.Text)) 

Note: <-- Barcode represents the column in your SP list, which stores the barcode value of the corresponding product. The 'YourSPList' represents the SP list which you pull data from into your Gallery.

 

 

In addition, if you want to save the pulled info (scanned via Barcode control) from your Gallery into your Inventory list, please take a try with the following workaround:

 

ForAll(
    RenameColumns(Gallery1.AllItems,"Barcode","Barcode1")
    If(
        IsBlank(LookUp('YourInventoryList',Barcode = Barcode1)),
        Patch(                  /* <-- There is no same product existed within your Inventory list*/
'YourInventoryList',
Defaults('YourInventoryList'),
{
ProName: ProductName,
Barcode: Barcode1,
Quantity: 1
...
}
), Patch( /* <-- There already has one same product existed in your Inventory list*/
'YourInventoryList',
LookUp('YourInventoryList',Barcode=Barcode1),
{
Quantity: LookUp('YourInventoryList',Barcode = Barcode1, Quantity) + 1
}
) ) )

Note: The Barcode, Quantity are both columns in your Inventoty list. The Barcode column used to store the barcode value of the corresponding product. The Quantity used to store the amount of the corresponding product.

 

More details about the ForAll function, Patch function and LookUp function, please check the following article:

ForAll function

Patch function

LookUp function

 

Best regards,

Kris

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hiattech
Level: Powered On

Re: check inventory stock

Guess I took a bit long to respond so the solution was considered accepted.  Sorry about that, I was traveling.  

 

To respond to your question, the first column in the list contains the numbers associated with the barcodes.  The second column is the name of the item, the third is how many are in stock, the fourth contains the picture (something I'm still working on) and the fifth is the inventory check column (which would contain how many we have scanned for our current inventory check.  

 

I'll review the information you have provided for me next week as I continue to work on the app and see if that solves my issue.  Thanks a lot for the help.

Hiattech
Level: Powered On

Re: check inventory stock

I have tried to implement this code but I'm having issues.  When I try 

If(!IsBlank(Barcode1.Text),Filter('Truck Inventory', CIMs_Number = Barcode1.Text))

it tells me the Barcode field is a number and can't be compared to Barcode1.Text

 

As for the second part of the code with the ForAll, is that being attached to a button or does that work on the fly?

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Kudoed Authors
Users Online
Currently online: 246 members 5,377 guests
Please welcome our newest community members: