cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted

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
Highlighted
Super User III
Super User III

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.

Highlighted

Hi @eka24 

 

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

Highlighted

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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (10,833)