Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Radio Button Default and UpdateIf Issue

(0) ShareShare
ReportReport
Posted on by 4,704 Super User 2025 Season 1

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:
  • Phineas Profile Picture
    4,704 Super User 2025 Season 1 on at
    Re: Radio Button Default and UpdateIf Issue

    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!

  • Verified answer
    WarrenBelz Profile Picture
    146,668 Most Valuable Professional on at
    Re: Radio Button Default and UpdateIf Issue

    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
    4,704 Super User 2025 Season 1 on at
    Re: Radio Button Default and UpdateIf Issue

    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.

  • GarethPrisk Profile Picture
    2,826 on at
    Re: Radio Button Default and UpdateIf Issue

    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?

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!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,668 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard