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

Making visible a label in a gallery

Hello, I'm trying to click on a button and trying to validate if the one gallery item is blank, there is also a label inside the gallery that contains a text "Quantity of Type Of Service should not be in blank" and is not visible, but when I press the button is not showing anything. What is wrong?

 

This is my code:

If(IsBlank(Gallery3_1.Selected.COLLQUANTITYTYPEOFSERVICE), Label21.Visible=true, Label21.Visible=false);

 

Thanks in advance for the assistance.

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @Emont ,

 

Since you will need a button to control the visible of the Label, please try below:

1\ Button OnSelect:

UpdateContext({Show:!Show})

 

2\ Visible of the Label:

If(IsBlank(ThisItem.COLLQUANTITYTYPEOFSERVICE), Show, false)

 

So the Label will only be visible when current item's COLLQUANTITYTYPEOFSERVICE field is blank and clicking the button once.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

4 REPLIES 4
StalinPonnusamy
Super User
Super User

Hi @Emont 

 

Set the Label visible property to

 

varShowError

 

Set the OnSelect property of the button to

 

UpdateContext({varShowError: IsBlank(Gallery3_1.Selected.COLLQUANTITYTYPEOFSERVICE)})

 

 

Note: The error will show for all rows when we do a gallery. Not on a specific row.

 


Thanks,
Stalin - Learn To Illuminate

Hello @StalinPonnusamy Thanks again for your reply.

 

It is working partially, because I have several lines in the gallery but as soon as I add a line for one of then the message dissappears:

 

Emont_0-1634683232809.png

The message in yellow (which is the message that I need to display) appears as soon as the screen appears, which is not bad but when I press the blue button to validate the fields from the gallery the other one that is empty, is not showing the yellow message:

Emont_1-1634683727033.png

 

How to fix it? thanks in advance.

 

StalinPonnusamy
Super User
Super User

Hi @Emont 

 

We don't need varShowError variable anymore. In this case, an Error message displays when the Qty is blank.

 

Set the visible property of Label to

IsBlank(QtyLabel.Text)

 

Note: Update QtyLabel to your Label name

v-jefferni
Community Support
Community Support

Hi @Emont ,

 

Since you will need a button to control the visible of the Label, please try below:

1\ Button OnSelect:

UpdateContext({Show:!Show})

 

2\ Visible of the Label:

If(IsBlank(ThisItem.COLLQUANTITYTYPEOFSERVICE), Show, false)

 

So the Label will only be visible when current item's COLLQUANTITYTYPEOFSERVICE field is blank and clicking the button once.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (3,426)