cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ssvk
Level: Powered On

How to hide forms based on radio button?

Hi , 

 

I have 3 radio fields - Radio1, Radio2 , Radio 3 with YES/NO options.

I have 3 forms in one screen  - Forms1, Forms2 , Forms3.

 

IF Radio1.value = YES  , Form1. visible = TRUE else FALSE.

similarly for 2 & 3.

 

I am not able to implement, can someone help 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: How to hide forms based on radio button?

Hi @ssvk,

You should use one Radio control with 3 choices in the items property [Forms1,Forms2,Forms3] or a more descriptive name for your forms. Make the Visible property of Form1 - Radio1.Selected.Value=Forms1

Visibility property of Form2=Radio1.Selected.Value=Forms2, etc by using one radio control you will prevent more than 1 form from being Visible at the same time.

View solution in original post

3 REPLIES 3
Super User
Super User

Re: How to hide forms based on radio button?

Hi @ssvk,

You should use one Radio control with 3 choices in the items property [Forms1,Forms2,Forms3] or a more descriptive name for your forms. Make the Visible property of Form1 - Radio1.Selected.Value=Forms1

Visibility property of Form2=Radio1.Selected.Value=Forms2, etc by using one radio control you will prevent more than 1 form from being Visible at the same time.

View solution in original post

ssvk
Level: Powered On

Re: How to hide forms based on radio button?

Hi @Drrickryp,

 

Thanks for your response, 

I somwhow have a different problem statement where I have 5 datacards of radio button and based on that I have to show forms - 

well this worked out - on VISIBLE prperty of forms;

If(Equipment.Selected.Value="Yes",true,false)

KroonOfficeSol
Level 10

Re: How to hide forms based on radio button?

He @sskv,

 

First you don't have to use a If() formula at all, this because you're condition is true or false by default. 

If it should be possible to show all the forms at once then radio button could be the way to go. Then you just use the formula:

 

RadioButton.Selected.Value = ''

If you want it to show on a combination you just do:

RadioButton1.Selected.Value = '' || RadioButton2.Selected.Value = ''

If you want it to be visible on false then add the not parameter like:

!(RadioButton.Selected.Value = '')


If only one screen should be visible at a time then get rid off the radio buttons and add a button (or Icon or Image control with a nice icon from PowerPoint for example) for each forms. Here you use a number variable. Formula():

UpdateContext({Scr_Show:1})

On the second and third button you use 2 and 3.  Then on the screens.visible property you use:
  

Scr_show = 1

 

On the second and third button you use 2 and 3 again. 

If you want to show one off the screens at start then use in and add Blank(). With this you don't have to set you're variable at .Start/.OnVisible. This goes like:

Scr_show in [Blank(), 1]

 

I posted several video's on YouTube which explains the logic behind this approach, you can see them here YouTube Learn PowerApps. Start at video 14 till 19. This will basically teach you how to build a 30 screen app in just one screen and control the visibility off groups/controls with a few variables. 

 

Btw, a nice effect is to set the buttons color/fill referenced to the header. Then use a if() formula to check on the Scr_show variable and set the color/fill to the opposite for the true and false result. Your button then stands out when it is selected. Formula is like:

 

If(Scr_Show = 1, Header.Fill, Header.Color) // on the first button

If(Scr_Show = 2, Header.Fill, Header.Color) // on the second button

If(Scr_Show = 3, Header.Fill, Header.Color) // on the third button

His would be for the .Color attribute off the button. So for the .Fill you turn the true and false parts around.

 

 

Hope this helps.


Greatings Paul

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,812)