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

Some Questions

Hi,

 

1. Is it possible when you click on a button a small box appears and give you a message. Something like "This place is taken" like a small hint.

2. I have two small rectangles. One of them should disapear when the number of seats is smaller then 4. If it´s higher then 5 it should be red. Now I´m trying to use this if function but it´s not working right. 

 

If(ThisItem.number_x0020_of_x0020_seats<4,White, Red)

 

In this case it´s right but in the other case it´s still red...

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Hi @Belasor

 

1. To do this you will have to have to setup 4 things.

  a) Have a a Context Variable that regulates visibility ( _VisibleBox )

  b) Have a rectangular box (Rectangular1)

  c) Have a label (Label1)

  d) Have a button (Button1)

 

In your screen OnVisible put this function:

 

UpdateContext({_VisibleBox:false})

In your Button1.OnSelect put this function:

 

 

UpdateContext({_VisibleBox:true})

 

In your Label1.Visible and Button1.Visible put this function:

 

_VisibleBox

 

Now anytime someone clicks the button this box with message will display. You can program additional fucntinality like an X icon to close the box.

 

2. To make one rectange disapear when number of seats is smaller than 4 (it will still show when numbe rof seats are equal to 4). Put the following function in  Rectangle.Visible:

If(
  ThisItem.number_x0020_of_x0020_seats<4,
  false, 
  true
)

If you want to change the color to red if its higher than 5 (it will still be white if it is equal to 5), put the following function in the Rectangle.Color:

If(
  ThisItem.number_x0020_of_x0020_seats>5,
  Red, 
  White
)

View solution in original post

5 REPLIES 5
Memorable Member
Memorable Member

I think the solution for showing and hiding a text box can be found in this forum post here:

 

https://powerusers.microsoft.com/t5/PowerApps-Forum/Can-I-utilize-the-On-Select-function-do-display-...

Anonymous
Not applicable

Hi @Belasor

 

1. To do this you will have to have to setup 4 things.

  a) Have a a Context Variable that regulates visibility ( _VisibleBox )

  b) Have a rectangular box (Rectangular1)

  c) Have a label (Label1)

  d) Have a button (Button1)

 

In your screen OnVisible put this function:

 

UpdateContext({_VisibleBox:false})

In your Button1.OnSelect put this function:

 

 

UpdateContext({_VisibleBox:true})

 

In your Label1.Visible and Button1.Visible put this function:

 

_VisibleBox

 

Now anytime someone clicks the button this box with message will display. You can program additional fucntinality like an X icon to close the box.

 

2. To make one rectange disapear when number of seats is smaller than 4 (it will still show when numbe rof seats are equal to 4). Put the following function in  Rectangle.Visible:

If(
  ThisItem.number_x0020_of_x0020_seats<4,
  false, 
  true
)

If you want to change the color to red if its higher than 5 (it will still be white if it is equal to 5), put the following function in the Rectangle.Color:

If(
  ThisItem.number_x0020_of_x0020_seats>5,
  Red, 
  White
)

View solution in original post

This is almost exactly the solution in the link I provided, well done.

Helper III
Helper III

Sorry but he gave me a solution for both of my problems not just one of them.


@Belasor wrote:
Sorry but he gave me a solution for both of my problems not just one of them.

 

Both can be resolved by understanding variables and their ability to change the visibility of an item, which is what the solution provided you with.

 

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (35,302)