DataView Filter

Hi
when I put a filter on my dataview, if the text field is empty I do not see the data, to see it appear I must enter at least one letter, is it possible to put a condition indicating that it filters only if the 'input contains text?



I have

I would like

thanks

I use a variable and filter in relation to this variable, the starting value is * this displays everything, but if I do a search then delete my text input my variable ends up empty and my table disappears,

Subsidiary question: is it possible to have different types of search with equals and contains depending on the column, be careful I use a dataview because I use a list and not a table

Are you setting a filter in your query step? If so, set a condition like so.

This will only filter the results by the value if there is a value. It will show all records by default.

Unfortunately my data is encrypted in the table, so I cannot compare it. so I go through a list to describe them,

Hey @kryo91,

You say:
“I use a variable and filter in relation to this variable, the starting value is * this displays everything”
I suppose that this is on server side…
So, you can check if the variable is * OR ‘’ (empty string)

  • I don’t know if you should then trim the variable to eliminate the spaces

@Teodor is it possible to filter a dataview other than with the filter options field? is it possible to have multiple filters? and some with one containt and other with equal Thanks

@teodor an idea? thanks for advance

@kryo91,

As I can understand from your screenshots, you fetch your data in your serverconnect and feed the dataview data_viewRevendeur.
You have a filter in your dataview. This must be the textinput recherche on the left that does what?
What is the exact condition in this dataview filter?
Because I am confused from your initial comment:

Anyway, I suppose you want to show all your records if the search value is ‘*’ or blank… Otherwise search a field (or fields) to contain that search value,
Am I right?
watch the video:

In case of prodSearch textinput is “*” or is empty (lenth()==0) I search for something that I’m sure that all the records match, and it is prd_Name.lenth()>0
Otherwise show only products that prd_Name.contains the prodSearch.value

*I used .lowercase() to tranform both values because contains() is case is case sensitive.
and .trim() to eliminate whitespaces

I hope it helps

Thanks famousmag, i’ll try.

filter="(filterfield.lowercase().contains(textfilter.value.lowercase())"

Nothing else required

1 Like

Thank you, but how can I filter on a second field as well,

OR = (condition1 || condition2)
AND = (condition1 && condition2)

Here’s an example of a single field filtering on 2x fields in result set. You can use || (OR) || && (AND) as Boolean operators - include brackets to enforce precedence as the complexity grows.

filter="( (filterName.lowercase().contains(textfilter.value.lowercase() || filterAddress.lowercase().contains(textfilter.value.lowercase()) )"

Here’s an example of a single field filtering on 2x fields in result set. You can use || (OR) || && (AND) as Boolean operators - include brackets to enforce precedence as the complexity grows.
filter="( (filterName.lowercase().contains(textfilter.value.lowercase() || filterAddress.lowercase().contains(textfilter.value.lowercase()) )"

Unfortunately it tells me that the syntax is not correct
Could you help me with my fields

search field : recherche.value
contain field : raison (text value)
equal field : coderevendeur (number value)

Thanks

@scalaris thanks