web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Setting Ungroup funcit...
Power Apps
Unanswered

Setting Ungroup funciton for several values

(0) ShareShare
ReportReport
Posted on by 42

Hello i need some help here,

 

So i have two tables names "Tested_x0020_Property" and "Device", i want both of them to be Filtered.

However when using the "Ungroup function i can only put in "SelectProperty", however i would also need to put in "SelectDevice".

How do i add both in there?

 

E.g. SelectProperty.SelectedItems As aSel && SelectDevice.SelectedItems As aSel in the Ungroup function?

At the end it should filter both.

Chris1231_0-1689746932106.png

 

Categories:
I have the same question (0)
  • v-jefferni Profile Picture
    on at

    Hi @Chris1231 ,

     

    Could you please share more details about your scenario? Do you have two Combo boxes in you App, one for SelectProperty the other for SelectDevice? Would you like to filter the Testreports table where Tested Property column values in the values selected in SelectProperty Combo box And Device column values in the values selected in SelectDevice Combo box?

     

    If this is the case, please try below formula, UnGroup is not needed:

    Filter(
     Testreports, 
     Tested_x0020_Property.Value in SelectProperty.SelectedItems.Value 
     && 
     Device.Value in SelectDevice.SelectedItems.Value
    )

     

    Best regards,

  • Chris1231 Profile Picture
    42 on at

    Hi @v-jefferni ,

     

    Yes the Scenario is that i have two Comboboxes "SelectProperty" and "SelectDevice".

    The whole code is a snippet for a Search function.

    I'm using a Ungroup, because "SelectDevice" and "SelectProperty" are multi-select and both are are multi-Value choices fields.

     

    At the end i want to filter all Testreports that "includes" the SelectDevice and Selectproperty value.

    There are also other Filter values like Project, Year etc., they worked. However when trying to filter only these two values, it will only filter one of them.

     

    I hope that helps.

  • v-jefferni Profile Picture
    on at

    Hi @Chris1231 ,

     

    Have you tried the formula I previously gave you?

     

    Best regards,

  • Chris1231 Profile Picture
    42 on at

    Hi @v-jefferni ,

     

    Yes I tried that one, however it did not work.

     

    Best regards

    Christ

     

  • v-jefferni Profile Picture
    on at

    Hi @Chris1231 ,

     

    It's giving an error or just no outputs?

     

    Best regards,

  • Chris1231 Profile Picture
    42 on at

    Getting an error similar to the case i had here: https://powerusers.microsoft.com/t5/Building-Power-Apps/Filtering-a-choices-table-for-Gallery/m-p/2223817#M557011

     

    Best regards

    Christ

     

     

  • v-jefferni Profile Picture
    on at

    Hi @Chris1231 ,

     

    I understand your scenario now. Since you have two columns having N:N relationship with another two lists, the only way I can imagine is filter the list twice, each time on a single column:

    With(
     {
     wFilter: 
     UnGroup(
     ForAll(
     SelectProperty.SelectedItems As aSel1, 
     Filter(
     Testreports, 
     aSel1.Value in Tested_x0020_Proerty.Value
     )
     ),
     "Value"
     )
     },
     UnGroup(
     ForAll(
     SelectProperty.SelectedItems As aSel2, 
     Filter(
     wFilter, 
     aSel2.Value in Devices.Value
     )
     ),
     "Value"
     )
    )

     

    Best regards,

  • Chris1231 Profile Picture
    42 on at

    Hi @v-jefferni ,

    Sorry should have been more accurate when explaining :).

    Can i nest it somehow in the If statement?

    I tried to put it in different locations, however it does not want me to nest it.

     

    Here is the If Statement, where I would like to nest it:

     

    If(
     IsBlank(SearchItem.Text) && 
     IsEmpty(SelectProject.SelectedItems) && 
     IsEmpty(SelectYear.SelectedItems) && 
     !IsEmpty(SelectDevice.SelectedItems) &&
     !IsEmpty(SelectProperty.SelectedItems),
     
    Ungroup(
     ForAll(
     SelectProperty.SelectedItems As aSel,
     Filter(
     Testreports,
     aSel.Value in Tested_x0020_Property.Value &&
     aSel.Value in Device.Value 
     )
     ),
     "Value"
     )

     

     

     

  • v-jefferni Profile Picture
    on at

    Hi @Chris1231 ,

     

    Just replace the entire UnGroup function in your formula with my formula.

     

    Best regards,

  • Chris1231 Profile Picture
    42 on at

    Thanks much!

    I manage to nest it, when trying it out it will search not both criteria.

    It will always take the "SelectDevice", but not the "SelectProperty" as criteria.

    Is there a way to change that?

     

    If(
     IsBlank(SearchItem.Text) && 
     IsEmpty(SelectProject.SelectedItems) && 
     IsEmpty(SelectYear.SelectedItems) && 
     !IsEmpty(SelectDevice.SelectedItems) &&
     !IsEmpty(SelectProperty.SelectedItems),
     
    With(
     {
     wFilter: 
     Ungroup(
     ForAll(
     SelectProperty.SelectedItems As aSel1, 
     Filter(
     Testreports, 
     aSel1.Value in Tested_x0020_Property.Value
     )
     ),
     "Value"
     )
     },
     Ungroup(
     ForAll(
     SelectDevice.SelectedItems As aSel2, 
     Filter(
     wFilter, 
     aSel2.Value in Device.Value
     )
     ),
     "Value"
     )
    )
    )

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard