cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
JeffersonExpert
Level: Powered On

filter items in the gallery or by text entry or by dropdown

Hello everyone, I have a problem with a field and a drop-down menu that I can filter in the gallery, but the filtering does not work perfectly, I'd like the drop-down menu to start with a null value and I was able to filter both by field or by drop- help, please

 

My code

Filter('[dbo].[vwv_Clientes Ativos]';StartsWith(Nome;txt_buscar.Text ) && DescrCategoria =  DropdownFiltro.SelectedText.Value )

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: filter items in the gallery or by text entry or by dropdown

HI @JeffersonExpert 

 

From what I see as per your screenshot, you currently don't have the null/blank value in your dropdown, you can add a blank value bu following below steps:
 
If you have a fixed number of values as your dropdown items, then you can modify the items as 
["","Normal","Diamond","Gold","Relaconion"]
If you are getting these values form the datasource, then you might want to create a local collection, which will hold the values. This can be done on the "OnVisible" property of your page.
ClearCollect(myDropdownValues, {Result:""});Collect(myDropdownValues, Distinct('[dbo].[vwv_Clientes Ativos]',DescrCategoria))
and you can use this collection for the dropdown "Items" property.
For the filter query, you might want to modify this as:
Filter('[dbo].[vwv_Clientes Ativos]';StartsWith(Nome;txt_buscar.Text ) && If(DropdownFiltro.Selected.Result = "",true,DescrCategoria =  DropdownFiltro.Selected.Result))
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
4 REPLIES 4
Super User
Super User

Re: filter items in the gallery or by text entry or by dropdown

HI @JeffersonExpert 

 

From what I see as per your screenshot, you currently don't have the null/blank value in your dropdown, you can add a blank value bu following below steps:
 
If you have a fixed number of values as your dropdown items, then you can modify the items as 
["","Normal","Diamond","Gold","Relaconion"]
If you are getting these values form the datasource, then you might want to create a local collection, which will hold the values. This can be done on the "OnVisible" property of your page.
ClearCollect(myDropdownValues, {Result:""});Collect(myDropdownValues, Distinct('[dbo].[vwv_Clientes Ativos]',DescrCategoria))
and you can use this collection for the dropdown "Items" property.
For the filter query, you might want to modify this as:
Filter('[dbo].[vwv_Clientes Ativos]';StartsWith(Nome;txt_buscar.Text ) && If(DropdownFiltro.Selected.Result = "",true,DescrCategoria =  DropdownFiltro.Selected.Result))
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
JeffersonExpert
Level: Powered On

Re: filter items in the gallery or by text entry or by dropdown

@yashag2255  , But once thank you very much for helping me in this problem, well I get this way based on your response, however it gets a yellow signal and with a notification could help me to strip it?

Super User
Super User

Re: filter items in the gallery or by text entry or by dropdown

@JeffersonExpert 

 

The warning that you are getting is because of delegation which will look for only first certain number of records. This limit is decided by Data Row Limit for Non-Delegable Queries, you can check this setting in:
 
File -> App Settings -> Advanced Settings -> Look for Data Row Limit for Non-Delegable Queries -> If this limit is set to 500, you can modify it to 2000. This sets the maximum number to be fetched at a time to 2000. 2000 is the maximum capped value.
 
If there are any cases, where matching records crosses this 2000 threshold, you might want to create a local collection of all the data from your table and you can achieve this this by pulling data in batches of 2000.
 
Hope this Helps!
JeffersonExpert
Level: Powered On

Re: filter items in the gallery or by text entry or by dropdown


thank you very much, it worked for me grateful.