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
v-yutliu-msft
Community Support
Community Support

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 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?

v-yutliu-msft
Community Support
Community Support

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
User Groups Public Preview

Join us for our User Group Public Preview!

Power Apps User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

Power Apps Community Call

Monthly Power Apps Community Call

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

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (45,838)