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 / Radio Button Default a...
Power Apps
Answered

Radio Button Default and UpdateIf Issue

(0) ShareShare
ReportReport
Posted on by 5,331 Moderator

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.

Categories:
I have the same question (0)
  • GarethPrisk Profile Picture
    2,828 on at

    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?

  • Phineas Profile Picture
    5,331 Moderator on at

    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.

  • Verified answer
    WarrenBelz Profile Picture
    155,242 Most Valuable Professional on at

    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.

  • Phineas Profile Picture
    5,331 Moderator on at

    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!

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
Vish WR Profile Picture

Vish WR 914

#2
11manish Profile Picture

11manish 617

#3
Valantis Profile Picture

Valantis 598

Last 30 days Overall leaderboard