cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

OnSelect not working ??

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  

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User
Dual Super User

Re: OnSelect not working ??

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.

 

View solution in original post

13 REPLIES 13
Highlighted
Super User
Super User

Re: OnSelect not working ??

@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.

Highlighted
Anonymous
Not applicable

Re: OnSelect not working ??

@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.

Highlighted
Dual Super User
Dual Super User

Re: OnSelect not working ??

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.

 

View solution in original post

Highlighted
Super User
Super User

Re: OnSelect not working ??

@Anonymous 

Agreed with @RezaDorrani.  The best approach here is to test every element of the code inside a label to isolate the problematic code.

Highlighted
Anonymous
Not applicable

Re: OnSelect not working ??

@RezaDorrani 

 

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.  

Highlighted
Super User
Super User

Re: OnSelect not working ??

@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)

Highlighted
Dual Super User
Dual Super User

Re: OnSelect not working ??

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.

 

Highlighted
Anonymous
Not applicable

Re: OnSelect not working ??

I completely agree that it shouldn't be possible. My 'SKU_Data' table has values for SKU and description for every SKU listed, but missing values for Barcode. Hence why I want to filter the source down to the SKU and update the barcode values. I am going to redo the SKU Data table later to ight and I will revert back with my update. Thank you for the help and replies.
Highlighted
Anonymous
Not applicable

Re: OnSelect not working ??

@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

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (11,230)