cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Chrislgr59
Frequent Visitor

Filter on gallery with a collection and Table

Hey,

 

I try to make appear on a Gallery a collection (With the list of the months) as well as the year (Not in a collection) according to if in another table it does not exist:

either no record,

or the status of the record related to the month and year in my Gallery is not "ok". (In case someone start and don't finish inventory of actual month)

Knowing that :

-In my collection I only have the Months with their IDs

-The Years are not in my collection but directly generated on my gallery

-In my Sharepoint Table I have on 3 different columns Month, Year, Status

 

I tested many different solutions found on the internet and in the end I ended up with the following code (which of course does not work and not complete).

Filter(

Controle;

Filter(Inventaire;

LookUp(Inventaire;Controle.Mois=Mois And Value(Annee)=Annee;Statut) != "ok")

)

 

I thank you in advance,

 

Wishing you a good day,

 

Sincerely,

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Chrislgr59 ,

 

I copied the conditions without thorough checking, but actually you don't need any for Mois:

 

Filter(
	Controle, 
	Not(
		Mois in Filter(
			Inventaire;
			Value(Annee)=Annee And
			Statut = "ok"
		).Mois
	)
)

View solution in original post

3 REPLIES 3
BCBuizer
Super User
Super User

Hi @Chrislgr59 ,

 

The below should do the trick as 

 

Filter(
	Controle, 
	Not(
		Mois in Filter(
			Inventaire;
			Controle.Mois=Mois And
			Value(Annee)=Annee And
			Statut = "ok"
		).Mois
	)
)

 

In the nested filter clause it generates a table of valid inventory items. Then we use a filter with some operators to Filter() which items in the Controle list are Not() in the .Mois column of those filtered valid items.

 

Hope this helps.

Chrislgr59
Frequent Visitor

Thanks for your fast reply,

 

After trying it, it say Incompatible Type for comparison: Table, Text (In Controle.Mois= Mois) and

at the end they say that .Mois is not recognized

 

 

Hi @Chrislgr59 ,

 

I copied the conditions without thorough checking, but actually you don't need any for Mois:

 

Filter(
	Controle, 
	Not(
		Mois in Filter(
			Inventaire;
			Value(Annee)=Annee And
			Statut = "ok"
		).Mois
	)
)

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (3,426)