cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TrystanB
New Member

OnChange not firing in published version, works fine in studio.

I have a dropdown that is pulling data from CDS (custom entity). It is manually selected by the user, and the 'OnChange' (for DataCardValue6_1) is set to UpdateContext on a variable, setting the variable to a property of the selected item.  This is the actual code: 

 

UpdateContext({SecondApproverVar2: DataCardValue6_1.Selected.'Card Holder Display Name'}) &
Notify(SecondApproverVar2,Success)

 

As you can see, I also have it set to notify what the value is in the top bar (this is just for testing purposes). 

 

All of this works perfectly in Studio.  (The end-goal is to update a second dropdown via filtering the list of names based on the display name property of the selected credit card holder -- as long as the 'SecondApproverVar2' updates, this works perfectly as well). 

 

In Studio, the OnChange fires, the variable updates, and the success notification shows the selected name at the top of the screen. 

In 'Play' from the published version, the variable does not change and the success notification does not trigger.  There is no error message in Studio debugger.  Monitoring the app shows the OnSelect firing (which doesn't have anything coded on my end), but does NOT show the OnChange firing, or any of the subsequent items (like the notification bar): 

This is the OnSelect that fires, according to the Monitoring console: 

 

{
  "time": 1599241005162,
  "category": "UserAction",
  "name": "Select",
  "logLevel": 2,
  "data": {
    "context": {
      "entityName": "DataCardValue6_1",
      "propertyName": "OnSelect"
    }
  },
  "controlName": "DataCardValue6_1",
  "propertyName": "OnSelect",
  "formulaData": {
    "script": ""
  }
}

 

 

I am running the latest PowerApps build: 3.20084.9.  I have also tried the previous build, and there was no change in behavior. 

I opened a ticket with Microsoft Support two weeks ago, but they were not able to resolve it or give any pointers- I ended up closing the ticket. 

 

Anyone come across this issue before \ any ideas?

 

Many thanks!

 

T

 

 

6 REPLIES 6
AmirBakht
Helper IV
Helper IV

Haven't seen this particular issue but just remember in Studio the variables, collections, connections etc. get maintained every time you run it. To see the same result as the published version, I'd suggest closing the App. Open it up again. Click on the ... for App and click Run OnStart, then F5 on your start screen to take it through the same route as the published Play.

@AmirBakht  - thanks!  I just tried that, and here's what happened:   On the first time clicking on the dropdown and changing it, the onchange didn't fire (exactly what happens in the "production" version, as you predicted).  Clicking the dropdown a second time did fire the OnChange and everything worked as intended.   Note that clicking a second time in the Production version does not cause the OnChange to fire.   There were no errors or notifications on the first attempt, either -- just like the production version, it simply did nothing as if nothing was pressed. 

Just before your notify, there is an &, shouldn't this be a ; ?

Tried that as well -- still not firing the onchange event at all in production, but works fine in studio. 

 

 

Scott_Slice
Frequent Visitor

I am seeing the same behavior.  I have the below formula in the Default value of my DataCardValue44.  When the OnChange event of DataCard53 (a combo box) fires it should update the value in my DataCardValue44.  It works perfectly fine in the studio and then does not work in the published version.

 

DataCardValue66.Selected.pmo_number_lvl1 & "." & Text(Value(Right(DataCardValue53.Selected.'PMO Code',4)))

 

deep_Shobhit
Regular Visitor

Same problem here... 😞

 

Did anyone found a solution to this?

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,268)