Using filters in CDT

Certified Senior Developer

Hello,

I have a gridField which reads the data from a CDT.

What is the best solution filtering the data having the operator "includes" and use multiple filters?

Thank you!

  Discussion posts and replies are publicly visible

Parents Reply
  • If you have all your data in a local variable or rule input which is of an array type, then try using index function based on the user entered filter. 

    For example : 

    local!data - is your array of data

    local!filter1 - name 

    index(

    local!data,

    wherecontains( value: local!filter1,

    array: index(local!data, "name", {})

    ), {} )

    But if you are getting data from a query entity , you don't need any indexing as you would hit the query each time you provide a filter. 

    a!gridField(
    label: "",
    /* Replace the dummy data with a query, rule, or function that returns a datasubset and uses fv!pagingInfo as the paging configuration. */
    emptyGridMessage: "No data matching the filers",
    data: rule!query(
    filter1: local!filter1,
    filter2: local!filter2,
    paging: fv!pagingInfo
    ),
    columns: {
    a!gridColumn(
    label: "Name",
    sortField: "name",
    value: a!linkField(
    links: a!recordLink(
    label: fv!row.name,
    recordType: recordtype!,
    identifier: fv!row.Id
    )
    )
    )

Children
No Data