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 updating ...
Power Apps
Answered

OnSelect not updating consistently

(0) ShareShare
ReportReport
Posted on by 26

Hello, 

 

There is an OnSelect property on a gallery that affects other elements in the app. When the 'gallery select' happens, the changes on the other elements do not consistently reflect. The changes on the other elements correctly reflect if the 'gallery select' action is performed more than once in sequence (i.e. another item is selected, the original item is reselected, the other item is reselected). The correct reflection of the OnSelect functions is not consistent.

 

Thank you for reading. What is the cause/solution?

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @weihu1 

    Can you describe your scenario a bit further as there is no OnChange action on a Gallery.

    Perhaps some screenshots of formulas or the formulas you are trying to achieve.

     

  • weihu1 Profile Picture
    26 on at

    @RandyHayes Hello, thank you for the reply. It is the OnSelect property. Sorry for the confusion.

    2021-04-14 09_36_24-Dimensional Analysis App - Saved (Unpublished) - Power Apps.png
    2021-04-14 09_36_01-Dimensional Analysis App - Saved (Unpublished) - Power Apps.png
    2021-04-14 09_35_08-Dimensional Analysis App - Saved (Unpublished) - Power Apps.png
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @weihu1 

    No problem.  I wanted to be clear in case you were referring to something else.

    Can you describe more about what is going on in your OnSelect action formulas and what is not happening properly?

  • weihu1 Profile Picture
    26 on at

    @RandyHayes You can see the attached images in the previous and this post. Each time the "1" and "2" box is selected, the resulting data below displays different states. The correct states include all or none of the data.

    2021-04-14 09_36_45-Dimensional Analysis App - Saved (Unpublished) - Power Apps.png
    2021-04-14 09_37_06-Dimensional Analysis App - Saved (Unpublished) - Power Apps.png
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @weihu1 

    That's all go that I see what you're seeing, but I can offer no suggestions without seeing the formulas on the controls that you have.  Need to see your OnSelect formula and why you have one as well as the formulas on the Default properties of the other controls.

     

  • weihu1 Profile Picture
    26 on at

    @RandyHayes Thank you for your reply. The OnSelect formula looks like this:

     

    Reset(drpDimCallout);
    Reset(txtDimValue);


    Set(dimDescription,"");
    Set(dimLocations,Blank());
    Set(dimInSpec,"");

     

    Set(dimDescription,Switch(...));

    Set(dimLocations,Switch(...));
    Set(dimInSpec,Switch(...));

     

    The 'Switch' statements contain 'If' statements that read from drpDimCallout and txtDimValue, which default to show a value if the Sharepoint list contains an entry or become blank if the list does not contain an entry.

    The idea is: The fields are reset and they shall default to containing a value or becoming blank and the other fields (dimDescription, dimLocations, dimInSpec are variables that the fields are using) will change afterwards.

  • Verified answer
    weihu1 Profile Picture
    26 on at

    @RandyHayes Hello Randy, thank you for commenting here yesterday. The 'Set' statements were changed to 'UpdateContext' statements and a few other changes were made to change the order of operations, and the end user is reporting that the app is working as intended. 

     

    Please refer to this post for more information: https://powerusers.microsoft.com/t5/Building-Power-Apps/Unable-to-clear-reset-label-Text-through-button-click/td-p/143230

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @weihu1 

    Yes, this is the drawback to using variables...you have to maintain them and do all kinds of extra work that PowerApps already does for you.

    Consider not using variables in these cases and you'll find you have less issues.

     

    Glad you have it working now.

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!

Leaderboard > Power Apps

#1
wolenberg_ Profile Picture

wolenberg_ 119 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 107 Most Valuable Professional

#3
Haque Profile Picture

Haque 103

Last 30 days Overall leaderboard