cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Questionasking
Helper III
Helper III

Mammoth of a visible variables etc.

Hi,

 

I have a question type canvas app with sharepoint as the datasource

 

In my app is around 30 radio buttons with the items ["OK","N/A","Defect"]

i then have a double check radio button with the items ["Yes","No"] and i have two Onselect buttons ill call camerabutton and another savebutton

 

once my users has answered every question and if they selected all OK and/or N/A in the questionaire id like for just the savebutton to be visible, however if the user selects one or more Defects in the questionaire id like for the Double check radio button to be visible and then if they select "Yes" on the double check radio button then the savebutton appears (and if they change that question from defect to OK to NA the double check disappears and the save button reappears) and if they select No on the double check radio button id like the camerabutton to appear,


I have tried so many many variables and options however im running around in circles, could someone please set me straight>?

Thankyou

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Questionasking ,

I've found that you posted another issue.

I've answered you in that issue, please refer that:
https://powerusers.microsoft.com/t5/Building-Power-Apps/Visible-Variables-multiple-conditions/td-p/6...

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
GarethPrisk
Resident Rockstar
Resident Rockstar

Probably the simplest pattern is to collect any negative response, and then base your eventual show/hide on whether or not there is a negative response in the collection.

 

To do this, you'll want to 'key' or have a way to identify each individual Radio button (for adding/removing a row from the negative collection). Simplest way to is just collect the Self property, so you don't have to track/add anything. It's less useful if you actually wanna use the objects in the collection, but we just want counts.

Set this to the OnChange property on all of your question radio buttons

If(
    Self.SelectedText.Value = "Defect", // Your 'negative' outcome,
    Collect(
        colNegativeResponse,
        {responseKey: Self}
    ),
    RemoveIf(
        colNegativeResponse,
        responseKey = Self
    )
)

 

This will insert a row into a collection (colNegativeResponse) if the negative response is selected for that control. It will also remove it, if the value is reverted.

 

Then you can simply do a IsEmpty(colNegativeResponse) or CountRows(colNegativeResponse) function to figure out if you have any negative responses (or how many).

 

You can elaborate on this logic, as needed, but this will account for your 30+ values.

v-yutliu-msft
Community Support
Community Support

Hi @Questionasking ,

Do you mean that:
1)all items are selected for OK and/or N/A, savebutton will be visible?

2)if the user selects one or more Defects, Double check radio button to be visible?

3)for double check radio button, if they select "Yes", then the savebutton appears

                                                     if they select "No", then camerabutton to appear?

If so, I've made a similar test for your reference:

1)gallery named Gallery1, radio inside gallery named Radio1(["OK","N/A","Defect"]), radio outside gallery named Radio2( ["Yes","No"])

2)set Radio1's Items:

 

["OK","N/A","Defect"]

 

Radio1's OnChange:

 

Reset(Radio2)

 

3)save button's Visible:

 

If(
    (IsEmpty(
        Filter(
            Gallery1.AllItems,
            "Defect" = Radio1.SelectedText.Value
               )
              ) ||   //no "Defect"
      Radio2.SelectedText.Value = "Yes"   //radio select yes
     ) && 
     IsEmpty(
        Filter(
            Gallery1.AllItems,
            IsBlank(Radio1)
              )
            ),          //all items has selected selection
    true,
    false
)

 

4)Radio2's Items:

 

["Yes","No"]

 

Radio2's Visible:

 

If(
    !IsEmpty(
        Filter(
            Gallery1.AllItems,
            "Defect" = Radio1.SelectedText.Value
               )
              ) &&    //select "Defect"
      IsEmpty(
        Filter(
            Gallery1.AllItems,
            IsBlank(Radio1) 
               )
             ),     //all items has selected selection
    true,
    false
)

 

5)camera button's Visible:

 

Radio2.SelectedText.Value="No"

 

923.gif

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.


@v-yutliu-msft wrote:

Hi @Questionasking ,

Do you mean that:
1)all items are selected for OK and/or N/A, savebutton will be visible?

2)if the user selects one or more Defects, Double check radio button to be visible?

3)for double check radio button, if they select "Yes", then the savebutton appears

                                                     if they select "No", then camerabutton to appear?

If so, I've made a similar test for your reference:

1)gallery named Gallery1, radio inside gallery named Radio1(["OK","N/A","Defect"]), radio outside gallery named Radio2( ["Yes","No"])

2)set Radio1's Items:

 

 

["OK","N/A","Defect"]

 

 

Radio1's OnChange:

 

 

Reset(Radio2)

 

 

3)save button's Visible:

 

 

If(
    (IsEmpty(
        Filter(
            Gallery1.AllItems,
            "Defect" = Radio1.SelectedText.Value
               )
              ) ||   //no "Defect"
      Radio2.SelectedText.Value = "Yes"   //radio select yes
     ) && 
     IsEmpty(
        Filter(
            Gallery1.AllItems,
            IsBlank(Radio1)
              )
            ),          //all items has selected selection
    true,
    false
)

 

 

4)Radio2's Items:

 

 

["Yes","No"]

 

 

Radio2's Visible:

 

 

If(
    !IsEmpty(
        Filter(
            Gallery1.AllItems,
            "Defect" = Radio1.SelectedText.Value
               )
              ) &&    //select "Defect"
      IsEmpty(
        Filter(
            Gallery1.AllItems,
            IsBlank(Radio1) 
               )
             ),     //all items has selected selection
    true,
    false
)

 

 

5)camera button's Visible:

 

 

Radio2.SelectedText.Value="No"

 

 

923.gif

 

 

 

Best regards,


None of my questions are in a gallery, they are all on one canvas app with radio buttons, the design i had to replicate made the app to be made this way.

Hi @Questionasking ,

So you did not display question list in one gallery?
Then how do you display those questions? By using what controls?
Sorry that I could not image your app's design.

Could you show me screen shoot of your app to help me understand?

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @Questionasking ,

I've found that you posted another issue.

I've answered you in that issue, please refer that:
https://powerusers.microsoft.com/t5/Building-Power-Apps/Visible-Variables-multiple-conditions/td-p/6...

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

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 (2,016)