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

Selecting buttons visibility based on varible

Hi,

 

I am new to powerapps but I am trying to set the visibility of a button based on a global variable.

 

So I have a dropdown box on my main menu called ddsiteselect and have a button next to it. On the button I have it Onselect =

Set(locat,ddsiteselect.SelectedText)

Then on my button I have tried a few things

If(locat=SiteA,"true","false")

 

Where am I going wrong?

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @moosebot88 ,

You just need this on the Visible property of the button - where xxxx equals the output (Value/Result/FieldName) of the dropdown

locat = ddsiteSelect.Selected.xxxx

 

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

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @moosebot88 ,

You just need this on the Visible property of the button - where xxxx equals the output (Value/Result/FieldName) of the dropdown

locat = ddsiteSelect.Selected.xxxx

 

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.

v-chenzhi
Community Support
Community Support

Hi @moosebot88,

Based on your description, I think you want to make the button visible based on the dropdown selected.

 

I just assume that you have a Choice column and set the Dropdown Items property as Choices(List.ChoiceColumn)

If so, please modify your formula as below:

Set(locat,ddsiteselect.Selected.Value)
If(locat=”SiteA”,true,false)

 

In addition,if you write your Set() formula on the Onselect property of Button,

and write the If() statement on the Visible property  to determine the visibility of the button,

this button will always be invisible because the untriggered variable is a null value. You can't even click on the button.

 

Best Regards,

Zhi Chen

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,008)