Skip to main content
October 9, 2023
Solved

Querying with a Filter that checks substrings of integer

  • October 9, 2023
  • 3 replies
  • 0 views

How could I query a database using a!queryFilter where the field it checks is an integer and would check if the search value is included in the whole integer?
e.g. If I searched "123" and one of the record items had an Id that is 123456789, I would like that item to show up in the resulting list.

Best answer by mikes0011

AFAIK you'd need to create a View where you cast the column as a text value, then use the text querying capabilities from there.  When filtering on pure numeric values, neither Appian nor the DB back-ends will make much sense over trying to do this.

3 replies

tejak2639
October 9, 2023

Hi,

I think in a!queryFilter if the field is integer we can use only some of the operators, And if it is string then we can take includes or start with operators which will be helpful for the solution.

But you are taking the integer field. So, instead of using a!queryFilter take a rule to get all the data and use "like" function to search for data and get the values that are true from the output(wherecontains), and get the whole data by indexing. 

I don't know whether it is exact solution but this will work

mikes0011
mikes0011Answer
Brainy
October 9, 2023

AFAIK you'd need to create a View where you cast the column as a text value, then use the text querying capabilities from there.  When filtering on pure numeric values, neither Appian nor the DB back-ends will make much sense over trying to do this.

October 10, 2023

Thank you. I think we can use this approach.