Skip to main content

Notifications

Community site session details

Community site session details

Session Id : uBhVoCf3jG/GIABDUKTAK0
Power Apps - Building Power Apps
Unanswered

Dropdown list selection not triggering OnChange in form datacardvalue when value is updated from Dropdown

Like (0) ShareShare
ReportReport
Posted on 6 Dec 2022 21:17:39 by 10

I have a dropdown list built from a SP list and when I make a selection I change the value in a form datacardvalue box which is successful.  However, I kickoff several processes from the OnChange of the datacardvalue, but the OnChange is not triggered for some reason.  It appears that the string update from the dropdown list does not emulate keystrokes so the OnChange is never triggered.  Any help with this would be greatly appreciated.

  • EddieE Profile Picture
    4,641 Super User 2025 Season 1 on 07 Dec 2022 at 21:11:41
    Re: Dropdown list selection not triggering OnChange in form datacardvalue when value is updated from Dropdown

    @bankhbl 
    Could you move you OnChange code from your Datacard to the OnChange of the Dropdown? Not 100% sure of your entire app logic but this may work?

     

    There seems to be some conflicting variables in your app. If this was my project, I'd add a number of labels each holding a different variable value then play the app and see how they all interact.

     

    Also, you could tidy up some of your code if you like?

    // Code refactoring
    
    // OnChange
    Set( valSave, DisplayMode.Edit);
    UpdateContext(
    	{
    		valStart: false,
    		varListSelect: false,
    		varAN: false
    	}
    )
    
    // OnSelect
    UpdateContext(
    	{
    		valStart: false,
    		varAN: true
    	}
    )
    
    // Default
    If(
    	varAN && varListSelect,
    	varDropDownItem,
    	Parent.Default
    )

     

     

  • bankhbl Profile Picture
    10 on 07 Dec 2022 at 13:22:39
    Re: Dropdown list selection not triggering OnChange in form datacardvalue when value is updated from Dropdown

    Thanks.  I've included two images to go along with the following description.

     

    The application scans and extracts text from magnetic tape labels and uses an AI model to put the text in the right Sharepoint column (the text boxes in the form.  Because there are so many different label formats there will be errors, so I built a dropdown list of all text extracted so the user can click on the datacard to update and then select the item in the dropdown which will then change the text in the datacard (this works fine).  The issue is that there are two Boolean variables set to control which datacard (each datacard has its own variable) will be updated (red box around Default).  The variable varAN is set to true in the OnSelect of the datacard select (this works) and the varListSelect variable is set to true when the item is selected in the list (works).  The issue is that when the new text from the dropdown string is inserted in the datacard the OnChange events (Green box) are not triggered which turns on the save edits button and updates the Boolean flag variables to keep same datacard from being updated again when the next datacard is selected for editing.

     

  • EddieE Profile Picture
    4,641 Super User 2025 Season 1 on 06 Dec 2022 at 21:58:21
    Re: Dropdown list selection not triggering OnChange in form datacardvalue when value is updated from Dropdown

    @bankhbl 

    You'll need to add some relevant code before anyone can help you with this.

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,776 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,093 Most Valuable Professional

Leaderboard
Loading started