SEARCH entire grid

Hi,

How can I make a SEARCH field to look up keywords to filter an entire grid rather than filter by just one column field of the grid? If a recipe exists on this topic, that would also be helpful. Thanks!

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer
    Generally Appian doesn't handle 'fuzzy' search logic like this very well. But for your use case, one easyish solution does occur to me: create a view displaying the columns you want displayed, and then add one last column (which you wouldn't display on your grid) which contains a concatenation of all the columns you want to be included in the "entire grid" search. In your Query Entity, you can filter on that hidden column, and as far as I can think of, will generally satisfy all the needs of this use case.
  • hello Morgan

    As mentioned by Mike concatenating could be a one option.

    If i am not wrong that is the normal behavior of the Record list when all the fields are strings, and I think it works even when other data types when working on MySQL for example.

    I suggest you to try this but the question is: could it be an option to use the “record list” as is ?
    Normally the situation is the other way around we create a report because we require complex filtering functionalities.

    Jose
  • +1
    Certified Senior Developer

    Morgan,

     

    If you were to have a table with 3 columns (i.e Value1, Value2, Value3) then you could run a value such as local!searchTerm against all 3 within a query entity using the operator 'includes' in order to check all potential columns data vs the search term.

    Local!searchTerm could be written to via a text field where the user could input whatever value they want to filter by. 

    See below for an example query entity:

    local!datasubset: a!queryEntity(
    entity: cons!DSE,
    query: a!query(
    selection: a!querySelection(
    columns: {
    a!queryColumn(field: "id"),
    a!queryColumn(field: "value1"),
    a!queryColumn(field: "value2"),
    a!queryColumn(field: "value3")
    }
    ),
    logicalExpression: if(
    isnull(local!searchTerm),
    /* If no search or filters have been used, don't filter the data in the query */
    null,
    a!queryLogicalExpression(
    operator: "OR",
    filters: {
    a!queryFilter(field: "value1", operator: "includes", value: local!searchTerm),
    a!queryFilter(field: "value2", operator: "includes", value: local!searchTerm),
    a!queryFilter(field: "value3", operator: "includes", value: local!searchTerm),
    }
    )
    ),
    pagingInfo: local!pagingInfo
    )
    )

     

    Jeremy Chen

  • Hi Morgane,

    Can you please elaborate more on your usecase.

    What you meant , search for entire grid. As per my understanding you want select one dropdown value that should be search and filter respective dataset.,

    AFIAK, this is not possible in appian grids. but it is default behavior in records.

    Regards,
    Bhanu.