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

Radio Control won't initiate Patch

I want to use a Radio control to update the status of the content of the 'ComplianceStatus' column on a 'List'.

 

When I change the Radio control manually the Patch works fine.

 

However, when I use the below to try to automatically manipulate the postion of the Radio control the control does indeed change to all three positions (as dictated by the toggles - see below), but the Patch does not fire.

What am I missing?

 

Controls:

   Radio1 - (Items: "NA","Compliant","Noncompliant")


                 (Default: Switch(Toggle1.Value,false,"NA",

                              Toggle2.Value=true,"Compliant","Noncompliant")


                 (OnChange: UpdateIf('Member List', ID=ThisItem.ID, {ComplianceStatus:

                                   If(Self.SelectedText.Value="NA","Compliant","Noncompliant")})   

   Toggle1 – true/false

   Toggle2 – true/false

 

Galleries:

   Gallery1 (Contents: Radio1, Toggle1, Toggle2)

2 ACCEPTED SOLUTIONS

Accepted Solutions
WarrenBelz
Super User
Super User

@Phineas ,m

OK - I get it now - it works when you manually change the toggle, but not when you trigger the change from another event - that is correct - OnChange must be triggered by the user on the control.

You might consider putting this on the OnUncheck of Toggle1

Patch(
   'Member List', 
   {ID:ThisItem.ID}, 
   {ComplianceStatus:"NA"}
)   

 

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

@Phineas ,

Yes - you can change the Radio Control using the Default, it just does not trigger the OnChange when you do it this way.

View solution in original post

5 REPLIES 5
WarrenBelz
Super User
Super User

@Phineas .

SelectedText is Deprecated - you need to use Selected. Also you might try this

With(
   {
      wComp:
      If(
         Self.Selected.Value="NA",
         "Compliant",
         "Noncompliant"
      )
   }, 
   Patch(
      'Member List', 
      {ID:ThisItem.ID}, 
      {ComplianceStatus:wComp}
   )
)                       

 

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.

 

Made the change, just as you show it.

 

Still nothing.

 

When I manually trigger the Toggle I can get the Radio control to move back and forth from 'Compliant' to 'Noncompliant', and both will update on the List. However, when I manually change the Radio to 'NA' the Patch updates the 'List' with the opposite of 'Compliant' or 'Noncomplaint'; it never updates 'NA' to the List.

 

Part of the process says - 'If Toggle 2 value equals 'false' then set the Radio control to 'NA'. This is the only way 'NA' is triggered, or you are either Compliat or Noncompliant.

The sequence of change in the Radio button is inconsistent. It doesn't like when 'NA' gets involved. 

 

Seems I can manually click back and forth between 'Compliant' and 'Noncomplaint' and the Patch will work. However, the Patch never updates 'NA'. It will update one of the other status choices instead of 'NA'.

 

Issue 1: No action triggers an 'NA' update of the List

Issue 2: The Radio button IS responding to the actions of the Toggle(s), however that action is not firing the Patch

             Toggle Sequence: If Toggle 2, false - Radio 'NA', else

                                          If Toggle 1, false - Radio 'Nonccompliant','Compliant'

WarrenBelz
Super User
Super User

@Phineas ,m

OK - I get it now - it works when you manually change the toggle, but not when you trigger the change from another event - that is correct - OnChange must be triggered by the user on the control.

You might consider putting this on the OnUncheck of Toggle1

Patch(
   'Member List', 
   {ID:ThisItem.ID}, 
   {ComplianceStatus:"NA"}
)   

 

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

Yep, you've figured out one part. I'll put the above in the Toggle. 

Are you also clarifying that I can NOT use the Radio button in this manner AT ALL? That the Radio button can NOT be triggered from the toggle bur must be manually manipulated in order for the 'OnChange' commands in the Radio to trigger?

 

If that is the case; I never had this problem until I thought I was learning Power Apps. Silly me!

 

Originally I had this all working through the two toggle, but had no 'NA' option, because toggles only have true/false. So, I figured Radio control - with that I can add the third position 'NA'. I guess not, since I lose the remote action function that way. 

 

Also, if I use the Toggle2 'OnUncheck' to Patch the 'NA', I also need a command in the Toggle2 'OnCheck' that reads the current true/false of Toggl1 and sets the 'ComplianceStatus' on the List based on Toggl1.

Basically, Toggle2 is an override to the default main Toggl1 (this toggle determine 'Compliance','Noncompliance' and registers that as the default setting in the List 'ComplianceStatus' column. Toggle2 overrides the content in the 'ComplianceStatus' column temporarily (if a member is away or out sick, no long "Active", click Toggle2 it will show them 'NA' on the List. When the member returns, click Toggle2 again, member's 'ComplianceStatus' should default to the the true/false state of Toggle1)

@Phineas ,

Yes - you can change the Radio Control using the Default, it just does not trigger the OnChange when you do it this way.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,586)