cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Post Prodigy
Post Prodigy

How to filter a nested gallery (gallery in gallery) so that result filters on both galleries?

I have a gallery within a gallery (nested gallery).

gallery1 and gallery2

gallery2 is inside gallery1

 

 

When i type in textinput1.text i want to filter gallery2 and show only values that are representing the text in textinput1.

i can do this with filter function, no problem.

 

but i also want gallery1 to only show those that have a result. i want to get rid of other records that do not show a result form gallery2.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Oskarkuus ,'

Assuming PersonalName is a Text field

Filter(
   datasource1;
   TextInput4.Text in Enhet && 
   Title in gallery2.AllItems.PersonalName
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

8 REPLIES 8
Super User III
Super User III

@Oskarkuus ,

Is Gallery2 based on a GroupBy function with the Items of the grouped data from the Gallery1 "main" field?

If so, you should be able to filter on CountRows(GroupedFieldName) to see if the main item has any "sub-items".

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Hmm.... Dont understand... Where do i put a groupby function and then how to type filter?

 

@Oskarkuus ,

This was a question rather than a solution. I wanted to know what data bound your nested galleries.

If it is not GroupBy, then what are the Items of both galleries?

oh sorry.

i am not using group by atall....

 

i have one gallery (gallery1)

then inside that i have gallery2.

 

on filter gallery1 i have this:

Filter(datasource1;TextInput4.Text in Enhet)

So when i type in Textinput4.Text i search the column "Enhet"

Then in gallery2 i have this:

Filter(datasource2;PersonalNamn_x003a_ID.Value=Label8_1.Text)

This filters the datasource2 to only show where relationship ID is equal to datasource1 ID of the current row.

(hope this makes sense)

 

it works

 

but now i want to add this to filter in gallery2

Filter(BUF_Utkomp_aktivitet;PersonalNamn_x003a_ID.Value=Label8_1.Text;Textinput7.Text in Aktivitet)

so when i type in Textinput7 i want to filter gallery 2 by column Aktivitet. But i also want to add so that i only see those records in gallery1 that do contain gallery2 results.

 

Hope i am being clearer 🙂

 

 

Thanks @Oskarkuus ,

Firstly, I can only rely on what  you posted on gallery 2 that this would be valid field names and values, but the syntax is correct

Filter(
   BUF_Utkomp_aktivitet;
   PersonalNamn_x003a_ID.Value=Label8_1.Text &&
   Textinput7.Text in Aktivitet
)

Now the piece you have not told me is what is the common key between the data sources - your first data source needs to have a field that matches whatever is displayed in gallery 2 - what are the field names and what types fields are they in both data sources?

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

The common key in gallery1 is Title column and in gallery2 it is PersonalName

Hi @Oskarkuus ,'

Assuming PersonalName is a Text field

Filter(
   datasource1;
   TextInput4.Text in Enhet && 
   Title in gallery2.AllItems.PersonalName
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Hi @Oskarkuus ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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 (93,936)