Filter the data

Hi ,

I have requirement that i need to create a grid from process model ( Process task report ) and filter the data 

load(
  local!pagingInfo: a!pagingInfo(startIndex: 1, batchSize:25),

  with(
  local!datasubset: a!queryProcessAnalytics(
  report: cons!MSL_TASK_REPORT_LEAD,
  contextProcessModels: cons!MSL_PARENT_PROCESS_MODEL,
  query: a!query(
  logicalExpression: a!queryLogicalExpression(
  operator: "AND",
  filters: {
  a!queryFilter(
  field: "c1",
  operator: "=",
  value: if(rule!MSL_checkIsNullOrEmpty(ri!status)," ",ri!status),
  ),
  a!queryFilter(
  field: "c9",
  operator: "=",
  value: if(rule!MSL_checkIsNullOrEmpty(ri!SgorDg)," ",ri!SgorDg),
  )
  },
  ),
  
  pagingInfo: local!pagingInfo
  )
  ),

  {
    a!boxLayout(
      label:"Tasks",
      style: "ACCENT",
      contents: a!sectionLayout(
        contents: {
          a!gridField_19r1(
            totalCount: local!datasubset.totalCount,
            value:local!pagingInfo,
            saveInto:local!pagingInfo,
            columns: {
              a!gridTextColumn(
                label:"Task Name",
                field:"c0",
                data:index(local!datasubset.data,"c0",{}),
                links:a!forEach(
                  items:index(local!datasubset,"identifiers",{}),
                  expression:a!processTaskLink(
                    task:fv!item
                  )
                )
              ),
              a!gridTextColumn(
                label:"Status",
                field:"c1",
                data:index(local!datasubset.data,"c1",{})
                
              ),
              
              a!gridTextColumn(
                label:"Process",
                field:"c2",
                data:index(local!datasubset.data,"c2",{})
              ),
              a!gridTextColumn(
                label:"Start Date",
                field:"c3",
                data:index(local!datasubset.data,"c3",{})
              ),
              a!gridTextColumn(
                label:"Task Id",
                field:"c4",
                data:index(local!datasubset.data,"c4",{})
              ),
              a!gridTextColumn(
                label:"Request Id",
                field:"c5",
                data:index(local!datasubset.data,"c5",{})
              ),
              a!gridTextColumn(
                label:"Active Task",
                field:"c6",
                data:index(local!datasubset.data,"c6",{})
              ),
              a!gridTextColumn(
                label:"Task Asignee",
                field:"c7",
                data:index(local!datasubset.data,"c7",{})
              ),
              a!gridTextColumn(
                label:"Process Id",
                field:"c8",
                data:index(local!datasubset.data,"c8",{})
              ),
              a!gridTextColumn(
                label:"SgorDg",
                field:"c9",
                data:index(local!datasubset.data,"c9",{})
              ),

              a!gridTextColumn(
                label:"End Time ",
                field:"c11",
                data:index(local!datasubset.data,"c11",{})
              )
            }
          )
        }
      )
    )

  }
  )
)
 

i passing this to my interface 

load(
  local!Status,
  local!MSL_SDGD,
  local!pagingInfo:a!pagingInfo(startIndex: 1, batchSize: 25),
 
  {
    a!columnsLayout(
      columns: {
        a!columnLayout(
          contents: {
            a!dropdownField(
              label: "MSL_SDGD",
              labelPosition: "ABOVE",
              placeholderLabel: "--- Select a Value ---",
              choiceLabels: {cons!MSL_SDGD[1],cons!MSL_SDGD[2] },
              choiceValues: {cons!MSL_SDGD[1],cons!MSL_SDGD[2]},
              value:local!MSL_SDGD,
              saveInto: {local!MSL_SDGD},
              
              validations: {}
            )
           
          }
        ),
        a!columnLayout(
          contents: {
           
            a!dropdownField(
              label: "Status",
              labelPosition: "ABOVE",
              placeholderLabel: "--- Select a Value ---",
              choiceLabels: {cons!TSL_REQUEST_STARUS[1],cons!TSL_REQUEST_STARUS[2] },
              choiceValues: {cons!TSL_REQUEST_STARUS[1],cons!TSL_REQUEST_STARUS[2]},
              value:local!Status,
              saveInto: {local!Status},
              validations: {}
            )

          }
        )
      }
    ),

    rule!MSL_Process_Report(SgOrDg:local!MSL_SDGD,status:local!Status)
  }
  
  
)

my requirement is without selection it should show grid and if i will filter it show appropriate selection 

thanks 

Dan

  Discussion posts and replies are publicly visible

Parents Reply
  • +1
    Certified Lead Developer
    in reply to danb0002

    You need to try the a!queryProcessAnalytics statement by itself (i.e. in a blank Expression Rule editor) and pass in different filter values manually until you figure out what works.

    Also be aware that portal reports can behave weirdly when filtering due to the default data types they use.  If you are trying to filter on Status, for example, and filtering on the current column doesn't seem to work, then I suggest editing your Report and adding a new column that you manually type-cast as integer (assuming it's numeric status IDs), i.e. actually use tointeger() in the column definition.  And then try filtering on this column instead of the original "status" column (don't remove the original one, just deal with having a functional duplicate).

Children