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

Compare Gallery items with a text

Hi

 

I have a gallery named BrowseGallery showing the name in each row (say A, B, C). I have one label with a text "A" and would like to make a comparison that if the text "A" appears in any row within BrowseGallery, then true, else false. May I know how can i achieve this?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Hor ,

Do you want to check whether there's same data in gallery, if yes the label will be visible, if not the label will be invisible?

Could you tell me data type and fieldname of the field that has value "A,B,C" in the gallery?

I assume as its data type is text and fieldname is Value.

Then you could set your app like this:

1)gallery's Items: ["A","B","C"]

2)label's Text: "A"

3)label's Visible:

If(
!IsEmpty(Filter(Gallery1.AllItems,Value=Label1.Text)),
true,
false
)

 

 

Best regards,

Community Support Team _ Phoebe Liu
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

3 REPLIES 3
eka24
Super User
Super User

If the Label is inside the Gallery then in the Text property of the label put:

 

If(ThisItem.ColumnName="A",true,false)

 

Change ColumnName to the column that contains the A B C

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Hi @eka24 

 

What if my Label is not within the Gallery ? How can I compare it with every name in the Gallery?

Hi @Hor ,

Do you want to check whether there's same data in gallery, if yes the label will be visible, if not the label will be invisible?

Could you tell me data type and fieldname of the field that has value "A,B,C" in the gallery?

I assume as its data type is text and fieldname is Value.

Then you could set your app like this:

1)gallery's Items: ["A","B","C"]

2)label's Text: "A"

3)label's Visible:

If(
!IsEmpty(Filter(Gallery1.AllItems,Value=Label1.Text)),
true,
false
)

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

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,580)