Hi everyone,
I have a collection of recipes and below all ingredients that may contain allergens.
Now I get this neatly filtered, but it would be nice if the recipe name only came up once.
For example, if a recipe contains several ingredients with allergens, I only need to see the recipe name once.
Is this possible?
I'll describe as best I can what I'm doing now.
OnButton:
ClearCollect(Col_AllergenenOpDatum, AddColumns(Filter('Keuken RecipesIngredients',riReceptID in Gallery_Dag0.AllItems.crReceptID),"ADDColIngredients",LookUp('keuken Ingredients',IngredientId=riIngredientID)))
OnGallery Items
Filter(Col_AllergenenOpDatum,
ADDColIngredients.crc99_ei = 'Ei (keuken Ingredients)'.Yes Or
ADDColIngredients.crc99_gluten = 'Gluten (keuken Ingredients)'.Yes Or
ADDColIngredients.crc99_lupine = 'Lupine (keuken Ingredients)'.Yes Or
ADDColIngredients.crc99_melk_lactose = 'Melk_lactose (keuken Ingredients)'.Yes Or
ADDColIngredients.crc99_mosterd = 'Mosterd (keuken Ingredients)'.Yes Or
ADDColIngredients.crc99_noten = 'Noten (keuken Ingredients)'.Yes Or
ADDColIngredients.crc99_pinda = 'Pinda (keuken Ingredients)'.Yes Or
ADDColIngredients.crc99_schaaldier = 'Schaaldier (keuken Ingredients)'.Yes Or
ADDColIngredients.crc99_selderij = 'Selderij (keuken Ingredients)'.Yes Or
ADDColIngredients.crc99_sesam = 'Sesam (keuken Ingredients)'.Yes Or
ADDColIngredients.crc99_soja = 'Soja (keuken Ingredients)'.Yes Or
ADDColIngredients.crc99_sulfiet = 'Sulfiet (keuken Ingredients)'.Yes Or
ADDColIngredients.crc99_vis = 'Vis (keuken Ingredients)'.Yes Or
ADDColIngredients.crc99_weekdier = 'Weekdier (keuken Ingredients)'.Yes
)
Text Recept
LookUp('Keuken Recipes',ReceptID=ThisItem.riReceptID,Recept)
Text Gluten For Example
If(LookUp('keuken Ingredients',IngredientId=ThisItem.riIngredientID,Gluten='Gluten (keuken Ingredients)'.Yes),"☑","☐")
I hope someone can make sense of this and point me in the right direction.
HI, Maybe "Distinct" can help with this.
Distinct function in Power Apps - Power Apps | Microsoft Docs
I suggest the GroupBy() function. You can create a gallery/subgallery by grouping on the recipe name and having a subgallery that contains the ingredients. see the documentation here on the GroupBy() function. https://docs.microsoft.com/en-us/power-apps/maker/canvas-apps/functions/function-groupby