Showing results for 
Search instead for 
Did you mean: 
Helper I
Helper I

Fields visibility based on selection from another field

I am new to power apps and I need some help to achieve the following... 


I have a form with various fields. One of the fields is the no of rooms which has a default value of one.

So, on my form I have the fields of



Room 1

Room 2

Room 3

Room 4 

Room 5


I want to show the fields of the Room 2, Room 3, Room 4, Room 5 only if the Rooms selection is more than 1. For example if I choose two rooms then Room 1 and Room 2 should be visible.


Not exactlly, I am talking about the visible property of each of the fields... 


I have a variable called varFormTab and I want the Room1 Room2 Room3 etc fields to be shown if that variable is set to ReservationDetails and also the new variable as per your instructions VisibleRooms which is set during the onChange of the Rooms field.


How do I translate that into code which should be placed on the Visible property of each of the buttons ?



Oh OK... then go to the Advanced tab of the fields an put the formula in the Visible property





Hi @Eickhel,


Do you want the Room1 to be shown up when varFormTab= "ReservationDetails" and VisibleRooms >= 1?


I think it is not necessary to initialize a variable to store the Rooms field value. I have made a test on my side, please take a try with the following workaround:5.JPG


Set the OnVisible property of the Room1 Data card control to following formula:

If(varFormTab="ReservationDetails" && Value(DataCardValue2.Text)>=1,true,false)

Note: The DataCardValue2 represents the Text input control (whose default value is 1) within the Rooms Data card control.


Set the OnVisible property of the Room2 Data card control to following formula:

If(varFormTab="ReservationDetails" && Value(DataCardValue2.Text)>=2,true,false)

Set the OnVisible property of the Room3 Data card control to following formula:

If(varFormTab="ReservationDetails" && Value(DataCardValue2.Text)>=3,true,false)

Set the OnVisible property of the Room4 Data card control to following formula:

If(varFormTab="ReservationDetails" && Value(DataCardValue2.Text)>=4,true,false)

Set the OnVisible property of the Room5 Data card control to following formula:

If(varFormTab="ReservationDetails" && Value(DataCardValue2.Text)>=5,true,false)


Best regards,



Community Support Team _ Kris Dai
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

That works like a charm! many thanks @v-xida-msft

Helpful resources

PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!


Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (86,690)