Task Report Status Filter not working

Hi ,

I am new to SAIL and I am trying to display a task report from one process model. I followed the Task Report Tutorial and did most of the things concerning it except the define status filter is not working .

Also I would like to display Assigners as users not a user name.

Could any with more experience with SAIL help me on it?

We are working with Appian  version 18.1.

Thanks in advanced.

BR,Natasa

  Discussion posts and replies are publicly visible

Parents
  • Can you post the full expression of what you have so far? Usually the best way to display a user's name is to using the user() function. You should be able to do something like this to show the users:

    a!gridTextColumn(
      label: "User",
      data: a!forEach(
        items: local!datasubset.data.c4 
        /* This will vary depending on the column you use */
        
        expression: user(fv!item, "firstName") & " " & user(fv!item, "lastName")
        /* This returns the users first and last name and concatenates them together */
      )
    )

  • The problem is that there are more than one assignee and I try to use rule which could work with more that one user but it wont work.And in mine case I create a dynamic data display , should I define static columns instead, or could be defined with dynamic data ? 

  • 0
    Appian Employee
    in reply to natasav

    Honestly I find the dynamic data hard to troubleshoot, so almost always use static columns. That being said, you can still do it with dynamic data. Can you please post your expression so we can help you troubleshoot it?

  • =load(
      local!pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 5),
      local!statusFilter: 0,
      with(
        local!report: a!queryProcessAnalytics(
          report: cons!BB_AllTask_Constant,
          contextProcessModels: cons!BB_PM,
          query: a!query(pagingInfo: local!pagingInfo)
        ),
        {
          a!dropdownField(
              label: "Status",
              choiceLabels: { "Assigned", "Accepted", "Completed", "Not Started" },
              choiceValues: enumerate(4),
              value: local!statusFilter,
              saveInto: local!statusFilter
          ),
          a!gridField(
            label: local!report.name,
            instructions: local!report.description,
            totalCount: local!report.totalCount,
            columns:{
              a!forEach(
                items: local!report.columnConfigs,
                expression: with(
                  local!columnData: index(local!report.data, fv!item.field, {}),
                  local!columnDataCount: count(local!columnData),
                  a!gridTextColumn(
                    label: fv!item.label,
                    field: fv!item.field,
                    data: if(
                      local!columnDataCount > 0,
                      a!forEach(
                        items: local!columnData,
                        expression: if(
                          fv!item = "TASK_STATUS",
                          index(
                            {
                              "Assigned",
                              "Accepted",
                              "Completed",
                              "Not Started",
                              "Cancelled",
                              "Paused",
                              "Unattended",
                              "Aborted",
                              "Cancelled By Exception",
                              "Submitted",
                              "Running",
                              "Error"
                            },
                            /*
                            * Task status ids start with 0, so add one to reach the first index 
                            */
                            tointeger(index(local!columnData, fv!item + 1, -1 )),
                            "Other"
                          ),
                          tostring(fv!item)
                        )
                      ),
                      {}
                    ),
                    links:{
                      if(
                      fv!item.configuredDrilldown = "TASK_DETAILS",
                      a!forEach(
                        items: index(local!report.data, fv!item.drilldownField, {}),
                        expression: a!processTaskLink(task: fv!item)
                      ),
                      null
                     ),
                     if(
                      fv!item.configuredDrilldown = "User_Profile",
                      a!forEach(
                        items: index(local!report.data, fv!item.drilldownField, {}),
                        expression: a!userRecordLink(label:rule!BB_Display_Full_Name_Multi(users:fv!item),user: fv!item)
                      ),
                      null
                     )
                     }
                   )
                    
                )
              )
            },
            value: local!pagingInfo,
            saveInto: local!pagingInfo
          )
        }
      )
    )

Reply
  • =load(
      local!pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 5),
      local!statusFilter: 0,
      with(
        local!report: a!queryProcessAnalytics(
          report: cons!BB_AllTask_Constant,
          contextProcessModels: cons!BB_PM,
          query: a!query(pagingInfo: local!pagingInfo)
        ),
        {
          a!dropdownField(
              label: "Status",
              choiceLabels: { "Assigned", "Accepted", "Completed", "Not Started" },
              choiceValues: enumerate(4),
              value: local!statusFilter,
              saveInto: local!statusFilter
          ),
          a!gridField(
            label: local!report.name,
            instructions: local!report.description,
            totalCount: local!report.totalCount,
            columns:{
              a!forEach(
                items: local!report.columnConfigs,
                expression: with(
                  local!columnData: index(local!report.data, fv!item.field, {}),
                  local!columnDataCount: count(local!columnData),
                  a!gridTextColumn(
                    label: fv!item.label,
                    field: fv!item.field,
                    data: if(
                      local!columnDataCount > 0,
                      a!forEach(
                        items: local!columnData,
                        expression: if(
                          fv!item = "TASK_STATUS",
                          index(
                            {
                              "Assigned",
                              "Accepted",
                              "Completed",
                              "Not Started",
                              "Cancelled",
                              "Paused",
                              "Unattended",
                              "Aborted",
                              "Cancelled By Exception",
                              "Submitted",
                              "Running",
                              "Error"
                            },
                            /*
                            * Task status ids start with 0, so add one to reach the first index 
                            */
                            tointeger(index(local!columnData, fv!item + 1, -1 )),
                            "Other"
                          ),
                          tostring(fv!item)
                        )
                      ),
                      {}
                    ),
                    links:{
                      if(
                      fv!item.configuredDrilldown = "TASK_DETAILS",
                      a!forEach(
                        items: index(local!report.data, fv!item.drilldownField, {}),
                        expression: a!processTaskLink(task: fv!item)
                      ),
                      null
                     ),
                     if(
                      fv!item.configuredDrilldown = "User_Profile",
                      a!forEach(
                        items: index(local!report.data, fv!item.drilldownField, {}),
                        expression: a!userRecordLink(label:rule!BB_Display_Full_Name_Multi(users:fv!item),user: fv!item)
                      ),
                      null
                     )
                     }
                   )
                    
                )
              )
            },
            value: local!pagingInfo,
            saveInto: local!pagingInfo
          )
        }
      )
    )

Children