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 Children
  • +1
    Certified Lead Developer
    in reply to danb0002

    In the process report, the back-end data for status actually is just integer IDs like that, 0, 1, etc (i think there are only a few).  If you add a new column with a similar definition to the original status column except cast as integer, you will see the status IDs.  All I can suggest is to just filter by these IDs.  I forget whether you would need to filter on an added column or not, but I wouldn't be surprised if that was the case as well.

  • Hi Mike ,

    How i cant get full name 

    a!gridTextColumn(
    label:"User Name",
    field:"c12",
    data:index(local!datasubset.data,"c12",{}),

    ),

    its giving me only " Hoker " Instead of "Dan Hoker "

    But is process report in user name column it is Dan Hoker but when i pull that data to my interface it is give me only "  " Hoker "

  • +1
    Certified Lead Developer
    in reply to danb0002

    As far as I know the back-end data for that column just stores the username.  The front-end layer for the portal reports (depending on how the column is defined) will then attempt to turn this username into a friendly display name for display purposes, but that doesn't affect the underlying data which is what you get as a query result.

    In your grid you have the easy opportunity to display the full name based on the user's name - you should have (or create) an expression rule that takes a username and displays the user's first and last name however you like.  The old "appian common objects" rule sets always had something like "APN_displayUser" which would do this, but it's very easy to make your own if necessary.

    Also I see that you're using the pre-19.2 style paging grid -- you would have a lot more flexibility with what you display if you upgrade this to the modern style grid.  Including not needing to call "index()" for the data/value parameters of all your grid columns.

  • yes , I'm geting full name but there is some name is not displaying 

  • +1
    Appian Employee
    in reply to danb0002

    What column are you using in the process report? The username could come from several columns, including Assignee, Owner, etc. Depending on the column, some of those may not be populated (or may even have users and groups). I'd suggest looking at the task report tutorial, since it describes how to handle formatting users.