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 / Gallery Filter Issue
Power Apps
Unanswered

Gallery Filter Issue

(0) ShareShare
ReportReport
Posted on by 349

I'm having difficulty filtering a Gallery. It works with a collection. It does not work with a SQL Server View, and I am not receiving any delegation warning. The filter is not consistent. What is the best method to filter a Gallery which is based upon a SQL Server view?

This is our code, leaving the ServiceCallFilter_txt.Text value blank returns about 135 rows.

 

Sort(
    Filter('[dbo].[vwFTM_Service_Call_All_iPad]',
ServiceCallFilter_Txt.Text in Service_Call_ID ||
ServiceCallFilter_Txt.Text in LocationId ||
ServiceCallFilter_Txt.Text in LocationName ||
ServiceCallFilter_Txt.Text in Service_Description ||
ServiceCallFilter_Txt.Text in CallType ||
ServiceCallFilter_Txt.Text in Technician ||
ServiceCallFilter_Txt.Text in Resolution_ID ||
ServiceCallFilter_Txt.Text in Status_of_Call)
,Service_Call_ID, Ascending)

 

Categories:
  • v-yuxima-msft Profile Picture
    Microsoft Employee on at

    Hi @vsslasd ,

     

    Is ServiceCallFilter_Txt is one textinput control do you check the text input is same as it in the view?

    Could you please remove the datasource and reconnect it again?

    Could you please turn off the off “Explicit column selection” option and “Improved app rendering” option in App settings ->Advanced settings panel and then close and reopen it again to test?

    20190226galleryfilterissue1.jpg

    I use your formula expression on my side and it test ok.( app test1 and result test as gif shows)

    App test1:

    20190226galleryfilterissue2.jpg

    20190226galleryfiltergif.gif

    Or Could you please create one collection firstly and use the collection to test?(as app test2)

    App test2:

    Add one button and Button6.OnSelect: ClearCollect(test3,'[dbo].[View_20190226vwFTM_Service_Call_All]')         ('[dbo].[View_20190226vwFTM_Service_Call_All]' is my view in sql,you can change to your view on your side)

    Gallery1.Items as the next screenshot shows

    20190226galleryfilterissue3.jpg

     

    Hope this can be helpful.

    Best Regards.

    Yumia

  • vsslasd Profile Picture
    349 on at

    Thank you,  Yumia.

     

    No luck. 

     

    I'm not exactly certain what you mean by: "Is ServiceCallFilter_Txt is one textinput control do you check the text input is same as it in the view?". Can you please clarify.

     

    I have removed the data source and added it back in. there is no change in the behavior, the search function does not work correctly. 

     

    I have never had "Explicit column selection" turned on. 

     

    Improved App rendering (Final Validation) I have turned off and on. I don't think it is quite ready yet. I have posted another issue in the forum on the pencil icon not appearing in the Gallery. I have a message: 

    "Improved app rendering is now even better and will soon replace classic rendering. Please try it again and let us know what you think. Try it now.", indicating it is turned off. 

     

    If I create a collection FIRST, then the filtering works correctly. 

     

    If I don't have a collection and if I instead reference the View itself, the filtering does not work at all. 

     

    The view is an Azure view. 

     

  • v-yuxima-msft Profile Picture
    Microsoft Employee on at

    Hi @vsslasd ,

     

    You are welcome.

    Firstly, I can answer your first question, ServiceCallFilter_Txt I mean it is one textinput control as next screenshots:

    20190227textinput.PNG

     

    Secondly, I used the view test  on my side and it is ok, the probably causes  for your issue I can't reproduce on my side but I can search or test again and again and try to find the cause. So could you please try with one collection now?

     

    Best Regards.

    Yumia

  • vsslasd Profile Picture
    349 on at

    Thank you, unfortunately no luck. It still is not working correctly. 

  • vsslasd Profile Picture
    349 on at

    The collection works perfectly fine, as originally stated. It's the view which does not work 😞

  • vsslasd Profile Picture
    349 on at

    Hello, Yumia.

    Still no luck with this item.

    I did though find a slight workaround:

    In the OnChange event of the Search Text TextBox, I am updating a variable with the value in the text box. Instead of referring to the value of the text box itself in my original example, I use the variable instead. this seems to restrict the Gallery based upon what is in the Text box.

    The only issue is that doing it this way, the user must click outside of the text box in order for the Gallery to filter.

    Again, it worked find with the Collection. Did not work with the View until I invoked this work around noted herein.

    If you folks can have a look at it from that perspective, it may help you all debug.

     

    This is the Gallery | Items Property:

    /*
    SortByColumns(Filter('[dbo].[vwFTM_Service_Call_All_iPad]',
    ServiceCallFilter_Txt.Text in Service_Call_ID ||
    ServiceCallFilter_Txt.Text in LocationId ||
    ServiceCallFilter_Txt.Text in LocationName ||
    ServiceCallFilter_Txt.Text in Service_Description ||
    ServiceCallFilter_Txt.Text in CallType ||
    ServiceCallFilter_Txt.Text in Technician ||
    ServiceCallFilter_Txt.Text in Resolution_ID ||
    ServiceCallFilter_Txt.Text in Status_of_Call),
    "Service_Call_ID", Ascending)
    */
    SortByColumns(Filter('[dbo].[vwFTM_Service_Call_All_iPad]',
    vServiceCallFilter_Txt  in Service_Call_ID ||
    vServiceCallFilter_Txt in LocationId ||
    vServiceCallFilter_Txt in LocationName ||
    vServiceCallFilter_Txt in Service_Description ||
    vServiceCallFilter_Txt in CallType ||
    vServiceCallFilter_Txt in Technician ||
    vServiceCallFilter_Txt in Resolution_ID ||
    vServiceCallFilter_Txt in Status_of_Call),
    "Service_Call_ID", Ascending)

     

     

    And the OnChange:

     

    Set(vServiceCallFilter_Txt,ServiceCallFilter_Txt.Text)

  • vsslasd Profile Picture
    349 on at

    Hello, Microsoft.

    Do you have any feedback on this issue ?

    It's still a problem.

     

    Thank you.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 394 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

Last 30 days Overall leaderboard