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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter in Gallery sudd...
Power Apps
Unanswered

Filter in Gallery suddenly not working anymore

(0) ShareShare
ReportReport
Posted on by 104

Hi there,

 

funny stuff happening. I have a kind of search/filter screen in my app that allows users to filter for different aspects of the SP list.

 

Item property of gallery:

Filter(
retrievaldata,
IsBlank(cvar_filter_mode) || mode.Value = cvar_filter_mode,
IsBlank(cvar_rv_select) || rv_flag = cvar_rv_select, //all boolean filters have a delegation problem, needs fixing before >500records
IsBlank(cvar_mm_select) || 'm&m_flag' = cvar_mm_select,
IsBlank(cvar_dcl_select) || approved = cvar_dcl_select,
IsBlank(Search_NHI.Text) || NHI = Search_NHI.Text,
IsBlank(Search_name.Text) || PatName = Search_name.Text,
IsBlank(cvar_filter_doc) || doc.Value = cvar_filter_doc Or doc_buddy.Value = cvar_filter_doc,
IsBlank(cvar_filter_nrs) || nurse.Value = cvar_filter_nrs Or nrs_buddy.Value = cvar_filter_nrs,
IsBlank(cvar_filter_date_start) || dpt_TPWO >= cvar_filter_date_start,
IsBlank(cvar_filter_date_end) || dpt_TPWO < DateAdd(date_end.SelectedDate, 1, Days),
IsBlank(cvar_comment_search) || rv_comment <> Blank()
)

 

Until I added the pink line the statements in the red lines worked fine, after adding the pink line they stopped working and returned empty galleries.

 

cvar_comment_search is set by the OnCheck/OnUncheck properties of a checkbox as follows:

OnCheck: UpdateContext({cvar_comment_search: true})

OnUncheck: UpdateContext({cvar_comment_search: true})

 

Same methodology is used for the cvar's in the red lines, but they are set to 1 or 0 to work with the SP list oddity in "handling" booleans.

 

What I am trying to achieve with the pink line is that the gallery shows all records where the comments field (multiline text) is not empty.

 

Happy about any suggestions here.

Hansjoerg

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,889 Most Valuable Professional on at

    Hi @ha_wai ,

    You need !cvar_comment_search to check if it is false - I have also added some bracketing to your code

    Filter(
     retrievaldata,
     (IsBlank(cvar_filter_mode) || mode.Value = cvar_filter_mode) &&
     (IsBlank(cvar_rv_select) || rv_flag = cvar_rv_select) &&
     (IsBlank(cvar_mm_select) || 'm&m_flag' = cvar_mm_select) &&
     (IsBlank(cvar_dcl_select) || approved = cvar_dcl_select) &&
     (IsBlank(Search_NHI.Text) || NHI = Search_NHI.Text) &&
     (IsBlank(Search_name.Text) || PatName = Search_name.Text) &&
     (IsBlank(cvar_filter_doc) || 
    	 (doc.Value = cvar_filter_doc || doc_buddy.Value = cvar_filter_doc)
     ) &&
     (IsBlank(cvar_filter_nrs) || 
     (nurse.Value = cvar_filter_nrs || nrs_buddy.Value = cvar_filter_nrs)
     ) &&
     (IsBlank(cvar_filter_date_start) || dpt_TPWO >= cvar_filter_date_start) &&
     (IsBlank(cvar_filter_date_end) || dpt_TPWO < DateAdd(date_end.SelectedDate, 1, Days) &&
     (!cvar_comment_search || rv_comment <> Blank())
    )

     

    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.

    Visit my blog Practical Power Apps

  • ha_wai Profile Picture
    104 on at

    Hi @WarrenBelz ,

     

    thanks for the prompt reply. Sadly it didn't make a difference. As soon as the last line is introduced again any of the pseudo-boolean filters return an empty gallery again.

     

    Could it be that there is a limit to the number of arguments you can use with filter?

     

    I will try later today or tomorrow by randomly commenting out some of the arguments to see if it makes a difference.

     

    Cheers

    Hansjoerg

  • WarrenBelz Profile Picture
    154,889 Most Valuable Professional on at

    Hi @ha_wai ,

    How many items are in the list - the <> filter is not Delegable, neither are the Boolean fields in conjunction with other filters (I see you have noted this). Also is rv_comment a multi-line field ?

  • ha_wai Profile Picture
    104 on at

    Hi @WarrenBelz 

     

    at this moment the list contains 67 records (we've only been filling it for about 6 weeks), so delegation is not yet an issue.

     

    And, yes, rv_comment is a multi-line field.

     

    At the moment, there seems to be another issue going on, we can't add anything to the list either directly nor via the app. I hope my IT-guys find out why soon.

  • WarrenBelz Profile Picture
    154,889 Most Valuable Professional on at

    Hi @ha_wai ,

    What is happening seems a bit strange (multi-line fields are not Delegable, but you can still use the  <> Blank() syntax). Try at ScreenOnVisible

    UpdateContext({cvar_comment_search: false})

    to at least give it an initial 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.

    Visit my blog Practical Power Apps

  • WarrenBelz Profile Picture
    154,889 Most Valuable Professional on at

    Hi @ha_wai ,

    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.

    Visit my blog Practical Power Apps

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 602

#2
WarrenBelz Profile Picture

WarrenBelz 473 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 310

Last 30 days Overall leaderboard