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

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.

View solution in original post

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 (50,126)