I have an inventory app that scans barcodes and then pushes the retrieved info along with Quantity to a OneDrive Document. This inventory side works fine.
I also have a screen for adding barcode values to the master list in OneDrive however, it is not working as expected.
This is the formula for the OnSelect Property of the Submit Button
Patch(SKU_Data, First(Filter(SKU_Data, SKU=skuInput.Text)),{Barcode: Value(barcodeInput.Text)})
When I click on the button nothing happens. Not sure what is going on.
All help is appreciated
Solved! Go to Solution.
Hi @Anonymous
Patch(SKU_Data, First(Filter(SKU_Data, SKU=skuInput.Text)),{Barcode: Value(barcodeInput.Text)})
First add 3 labels for testing purpose
Label1 - text - skuInput.Text
Label2 - text - Value(barcodeInput.Text)
Label3 - text - Lookup(SKU_Data, SKU=skuInput.Text).SKU
Make sure you have values for all the 3
Next
On select of a button try
Patch(SKU_Data, Lookup(SKU_Data, SKU=skuInput.Text),{Barcode: Value(barcodeInput.Text)})
Then go to sharepoint list and sort it by last modified date and check if the latest item has been modifed
If Yes, check value for barcode field
--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
@Anonymous
Well the good news is your formula looks proper! So I'm going to ask you to run a test to try and diagnose the problem.
My first suggestion is to check this portion of your code. Put this code in the OnSelect property of your button.
ClearCollection(myTest,First(Filter(SKU_Data, SKU=skuInput.Text)))
Now create a data table and use myTest as the datasource. Does the data table have any records? If no, this could be a sign you are not selecting the record correctly with Filter.
@mdevaney Nothing shows up.
I'm confused on how I am not selecting the record correctly though. The SKU Numbers do not repeat so First(Filter(SKU=skuInput.Text should filter to that one record.
Thanks for the quick reply.
Hi @Anonymous
Patch(SKU_Data, First(Filter(SKU_Data, SKU=skuInput.Text)),{Barcode: Value(barcodeInput.Text)})
First add 3 labels for testing purpose
Label1 - text - skuInput.Text
Label2 - text - Value(barcodeInput.Text)
Label3 - text - Lookup(SKU_Data, SKU=skuInput.Text).SKU
Make sure you have values for all the 3
Next
On select of a button try
Patch(SKU_Data, Lookup(SKU_Data, SKU=skuInput.Text),{Barcode: Value(barcodeInput.Text)})
Then go to sharepoint list and sort it by last modified date and check if the latest item has been modifed
If Yes, check value for barcode field
--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
@Anonymous
Agreed with @RezaDorrani. The best approach here is to test every element of the code inside a label to isolate the problematic code.
Ok I did the three labels.
When testing I have always been testing the same SKU Number. So with your third label I chose to do Description as the returned value. Now I do not get a value when I look up any of the new skus that were added. However if I lookup up the sku's that already have barcodes associated with them then I do get the description back on the lookup.
@Anonymous
Try refreshing your datasource. Then run the test again on the new SKUs. Do they appear now?
(I feel like once you've solved the main issue it would be a good idea to design for cases when the SKU is not yet input in the system)
Hi @Anonymous
For the 3 rd label
Lookup(SKU_Data, SKU=skuInput.Text).SKU - no value
Lookup(SKU_Data, SKU=skuInput.Text).Description - value
This is technically not possible since the lookup will only return values when SKU=skuInput.Text
skuInput.Text and Lookup(SKU_Data, SKU=skuInput.Text).SKU has to match
if they dont match then there is something wrong with your backend data
go to sharepoint list and do a query where SKU = output of skuInput.Text
--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
@RezaDorrani @mdevaney . I recreted the backend file and I was still unable to pull the description for alot of items. I then changed the data row value to 2000 and the descriptions for those items after the first 500 rows appeared. I was also able to successfully update the records using the formula @RezaDorrani provided.
However I would really like to know why my original formula did not work as that is straight from the documentation.
Thank you both
User | Count |
---|---|
253 | |
106 | |
88 | |
51 | |
43 |