how can i add two filter above the readonly gird

i want to add two filter about departemnt and status above list

how can i add it?

and my expression is written below

a!headerContentLayout(
  header: {},
  contents: {
    a!gridField(
      label: "タスク一覧",
      labelPosition: "ABOVE",
      data: a!queryProcessAnalytics(
        report: cons!DM01_process_report_pointer,
        contextProcessModels:cons!DM01_process_model_pointer,
        query:a!query(
          pagingInfo: fv!pagingInfo
        )
      ),
      columns: {
        a!gridColumn(
          label:"タスク内容",
          value:a!linkField(
            links: a!processTaskLink(
              label:fv!row.c0,
              task:fv!identifier
            )
          )
          
        ),


        a!gridColumn(
          label: "departement",
          sortField: "c4",
          value: fv!row.c4,
          align: "START"
        ),
        a!gridColumn(
          label:"status",
          value:rule!DM01_GetTaskName(status: fv!row.c1)
        ),
      
        
        a!gridColumn(
          label: "申請時間",
          value: text(fv!row.c3,"yyyy年 mmmdd日 hh:mm AM/PM")
        )
        
      },
      validations: {}
    )
  }
)

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    Hello  ,

    You can add two fields (based on the requirements - text or drop down) above the gridField() and the saved filter value can be passed in the query function to fetch the filtered data.

  • +1
    Certified Senior Developer

    Hi  ,

    you can use the below code for the requirement

    a!localVariables(
    local!deptFilter,
    local!statusFilter,
    local!pagingInfo:a!pagingInfo(1,1000),
    local!data:a!queryProcessAnalytics(
    report: cons!DM01_process_report_pointer,
    contextProcessModels:cons!DM01_process_model_pointer,
    query:a!query(
    pagingInfo: local!pagingInfo,
    logicalExpression: a!queryLogicalExpression(
    operator:"AND",
    filters:{
    a!queryFilter(
    field:"department",
    operator:"=",
    value:local!deptFilter
    ),
    a!queryFilter(
    field:"status",
    operator:"=",
    value:local!statusFilter
    )
    }
    )

    )
    ),
    a!headerContentLayout(
    header: {},
    contents: {
    a!columnsLayout(
    columns:{
    a!columnLayout(
    contents:{
    a!textField(
    label:"Department",
    value:local!deptFilter,
    saveInto:local!deptFilter
    )
    }
    ),
    a!columnLayout(
    contents:{
    a!textField(
    label:"status",
    value:local!statusFilter,
    saveInto:local!statusFilter
    )
    }
    )
    }
    ),
    a!gridField(
    label: "タスク一覧",
    labelPosition: "ABOVE",
    data: local!data,
    columns: {
    a!gridColumn(
    label:"タスク内容",
    value:a!linkField(
    links: a!processTaskLink(
    label:fv!row.c0,
    task:fv!identifier
    )
    )

    ),


    a!gridColumn(
    label: "departement",
    sortField: "c4",
    value: fv!row.c4,
    align: "START"
    ),
    a!gridColumn(
    label:"status",
    value:rule!DM01_GetTaskName(status: fv!row.c1)
    ),


    a!gridColumn(
    label: "申請時間",
    value: text(fv!row.c3,"yyyy年 mmmdd日 hh:mm AM/PM")
    )

    },
    validations: {}
    )
    }
    )
    )

    Note: Based on the requirement you can use dropdown fields instead of text field in the above code