cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Impactful Individual
Impactful Individual

check if all values in column match

Hey everyone,

 

I have a table, in which there is a column 'C' where I want to check if all values in that column match "X" or if all values match "Y" (or in between, but that's the 'else' of course).

 

I have some difficulty to find the correct way to do it. I got a bit stuck with using a Switch case that contain a ForAll loop that each would compare the result to "X" or "Y", but then I just loop over every item independly. I could use two counts to add 1 everytime I encounter "X" or "Y" and check if one of the two matches the amount of records in the table. But it sounds a bit much to check this.

 

Is there a better way to do this? Am I maybe overlooking something? 

 

Thank you already

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: check if all values in column match

Hi @SkiDK ,

 

Can you please share the related formula here? Also, did you mean that you want to check if all records in a gallery control include the letter "X" or "Y"?

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Impactful Individual
Impactful Individual

Re: check if all values in column match

Hey @v-monli-msft thanks for the reply

 

I have a table from which I want to see if all records match a certain value or not. I have 3 situations, either all record fields are 'X', all record fields do not match or all record fields are 'Y' (see image below)

 

XY.PNG

 

In Powerapps, how can I check if all fields match 'X', or 'Y', or it does not match either.

 

I was thinking doing something like this, but I'm not sure if this will work:

 

If (
    ForAll( Filter(coll, "Value") = "X" )),
    Execute code X,
    ForAll( Filter(coll, "Value") = "Y" )),
    Execute code Y
)

It's how to check if all values match 'X' or 'Y' (or else nothing happens)

 

The 'X' and the 'Y' are examples for strings I want to check matches on.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (8,407)