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 / Ungroup Filter and Sho...
Power Apps
Unanswered

Ungroup Filter and Showing All items if Blank or Please Select

(0) ShareShare
ReportReport
Posted on by 174

Hi,

 

Im using this piece of code to filter a gallery for a dropdown, im not understanding the code too well and im struggling to modify it the way i want.

 

I want the galleries item code below to also show all items in the gallery if the dropdown is blank or if the dropdown says "Please Select".

 

Could someone help me modify it?

 

Filter(
 Ungroup(
 ForAll(
 SQLHOLEIDDropdown.SelectedItems As aSel,
 SortByColumns(
 Filter(
 TEMPExpCollarData,
 BHID = aSel.HOLEID
 ),
 "Created"
 )
 ),
 "Value"
 ),
 !IsBlank(Created)
)
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at

    Hi @SomeoneAwesome ,

    Try this

    With(
     {
     wData:
     SortByColumns(
     Filter(
     TEMPExpCollarData,
     !IsBlank(Created)
     ),
     "Created"
     )
     },
     If(
     CountRows(SQLHOLEIDDropdown.SelectedItems) = 0,
     wData,
     Ungroup(
     ForAll(
     SQLHOLEIDDropdown.SelectedItems As aSel,
     Filter(
     wData,
     BHID = aSel.HOLEID
     )
     ),
     "Value"
     )
     )
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • SomeoneAwesome Profile Picture
    174 on at

    Thanks Warren works and all however im getting a delegation error at the ! in the snippet below and i cant have that as this temp list can be over 5k strong at times.

     

    Filter(
     TEMPExpCollarData,
     !IsBlank(Created)
     ),
     "Created"

     

  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at

    @SomeoneAwesome ,

    Correct - Not() is not Delegable - you were actually "masking" it before behind ForAll and Ungroup, which are hidden Delegation limitations, but how can created be blank in a SharePoint list ?

  • SomeoneAwesome Profile Picture
    174 on at

    What i need the gallery items code to do is to show the selected BHID's, however sometimes there is one or many BHIDs in one gallery and not the same BHIDs in the other so the code creates blank values for those when you select them in the combobox, then when you patch using the gallery items it tries to patch the blank rows and gives myself errors. Ive more or less finished this app besides three minor problems, this being one.

  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at

    @SomeoneAwesome ,

    The problem (if you have not realised it) is that if you bypass the other filter (as you need to do), the created Filter needs to "stand on its own" and directly filter on the data source, whereas in your earlier code, you had a "local" table already filtered you applied it to.

    I have been assuming created is date field - is that correct ? This is a bit left-field, but should work - just choose a value before any of your dates.

    With(
     {
     wDate:
     DateAdd(
     Today(),
     5,
     Years
     )
     },
     With(
     {
     wData:
     SortByColumns(
     Filter(
     TEMPExpCollarData,
     Created > wDate,
     ),
     "Created"
     )
     },
     If(
     CountRows(SQLHOLEIDDropdown.SelectedItems) = 0,
     wData,
     Ungroup(
     ForAll(
     SQLHOLEIDDropdown.SelectedItems As aSel,
     Filter(
     wData,
     BHID = aSel.HOLEID
     )
     ),
     "Value"
     )
     )
     )
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

     

  • SomeoneAwesome Profile Picture
    174 on at

    Hey mate, ive started a new thread for this one as my description is way off. Ill mark it as solved as your right. But what im trying to achieve is different. The next question will make more sense.

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard