cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Phineas
Post Partisan
Post Partisan

Radio Button Default and UpdateIf Issue

The following formula is not causing ants to march across my screen.

 

Anyone notice anything that would prevent this mass migration?

 

Radio1 Control - OnChange:

     UpdateIf('Member List', ID=ThisItem.ID, {ComplianceStatus: If(Self.SelectedText.Value="NA","Compliant","Noncompliant")})

 

Radio1 Control - Items 

     ["NA","Compliant","Noncompliant"]

 

Radio1 Control - Default

     Switch(Toggle1.Value,false,"NA",
                 Toggle2.Value=true,"Compliant","Noncompliant")

 

All functionality between these controls is working fine; except the UpdateIf it's updating when the Radio1 control position is auto-matically changed. The control visually is changing back and forth between the three options whent he toggles are manipulated. However, those changes are not being reflected in a Update to the MemberList through the Radio1 control 'OnChange' language shown above.

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User III
Super User III

Hi @Phineas ,

I thought I gave you the answer on this post.

Here is a test I did - a radio control's OnChange simply does not trigger unless it is changed at the control - I have a Notify on the OnChange of the Radio Control.

ChangeTrigger.gif

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

4 REPLIES 4
GarethPrisk
Super User II
Super User II

For the boolean controls (Checkbox, Toggle), you have to be very careful using the OnChange, OnCheck, OnUncheck hooks. Otherwise, you can get into scenarios where it becomes an infinite loop (recursive), and things will not behave as you'd expect. With the layered Toggle's - this may be the case.

 

You can check the monitor to see if multiple calls are being registered. Additionally, you can add a counter to your function to track if/when it is being recursively triggered. Something like

 

UpdateContext({locCounter: locCounter + 1});

 

Where is Toggle1 and Toggle2? It looks like the Radio Control may be in the Gallery - are the toggles?

Thank you for the reply. Yes, I've experienced the 'infinite loop'. This is not that.

 

All controls are in the same Gallery pulling data from the same MemberList.

 

Again, if I manully trigger the toggles their individual 'UpdateIf' work fine. One toggle can triggle the other from 'true' to 'false' and both 'UpdateIf' actions fire to the MemberList. If I manually trigger the Radio control it's 'UpdateIf' work fine. It's when I try the formula to automatically trigger the Radio control to 'switch' to 'NA' from 'Compliant', or any other configuration the visually the action happens on the screen (you can see the green compliance dot just to the red noncompliance dot, however no 'UpdateIf' occurs.

WarrenBelz
Super User III
Super User III

Hi @Phineas ,

I thought I gave you the answer on this post.

Here is a test I did - a radio control's OnChange simply does not trigger unless it is changed at the control - I have a Notify on the OnChange of the Radio Control.

ChangeTrigger.gif

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

That is fantastic!

 

Sorry for the run-around. 

 

I know my assumption was correct; I just couldn't get the language straight.

 

So, I ran from the issue - for expediency sake - and found another way.

 

Good to see it works; maybe someone else can use it.

 

Thanks again!

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,186)