web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / OnSelect not working ??
Power Apps
Answered

OnSelect not working ??

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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  

 

 

 

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,991 Moderator on at

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

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

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

  • Verified answer
    RezaDorrani Profile Picture
    12,145 on at

    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.

     

  • mdevaney Profile Picture
    29,991 Moderator on at

    @Anonymous 

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

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

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

  • mdevaney Profile Picture
    29,991 Moderator on at

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

  • RezaDorrani Profile Picture
    12,145 on at

    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.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at
    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.
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @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

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I went back and tried the formula with First and Filter and everything works now.  Not sure why it didn't work yesterday though.

     

    Thanks again

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 600

#2
WarrenBelz Profile Picture

WarrenBelz 478 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 322

Last 30 days Overall leaderboard