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
          )
        }
      )
    )

  • Here is the the interface but it does not work with multiple assignee and also still the usename appear. What I want the same presentation like in the process report .

    Any help with it will be much appreciate.

    Thanks in advance.

  • 0
    Certified Lead Developer
    in reply to natasav

    I urgently advise you to ditch the current concept of rendering all grid columns in a single forEach() statement.  You should be declaring all columns independently, manually, as you will find it 100x easier (being conservative here) to configure each one per what your exact interface wishes are.

  • 0
    Certified Lead Developer
    in reply to natasav

    Also I suggest you go check out a small helper app I developed and shared with the community a couple years ago - the Advanced User Task Report (which has an 18.1 version posted in the original thread luckily).  At the very least you could probably use this to see how to deal more effectively with columns in a portal report queried into a SAIL form, as well as ways to handle display of multiple assignees. 

    I have a newer (19.4) version ready too, which honestly does certain things a lot better and more easily, but it looks like you're stuck with 18.1 for now unfortunately.

  • I download the package for 18.1 and inspected first so following warnings/problems appear:

    APN_getEnvironmentURL

    The content [id= uuid=d422415e-833c-4393-99a6-aef6889316bf] was not imported because a required precedent is missing: content [uuid=_a-0000d73e-944a-8000-9ba2-011c48011c48_13373 location=Parent] cannot be found. (APNX-1-4070-001) (APNX-1-4071-006)

    Cascading problems too:

    Advanced User Task Report

    The tempoReport [id= uuid=2617b8c0-59f2-440d-8a9b-90eac4bba329] was not imported because a required precedent is missing: content [uuid=_a-0000e093-2743-8000-9ba2-011c48011c48_2538222 location=SAIL Dashboard] cannot be found. (APNX-1-4070-001) (APNX-1-4071-006)

    AUTR_UserTaskReport_Dashboard

    The content [id= uuid=_a-0000e093-2743-8000-9ba2-011c48011c48_2538222] was not imported because a required precedent is missing: content [uuid=d422415e-833c-4393-99a6-aef6889316bf location=Interface Definition] cannot be found. (APNX-1-4070-001) (APNX-1-4071-006)

    BR,Natasa

  • 0
    Certified Lead Developer
    in reply to natasav

    You need to import the contents of the Appian Common Objects Patch I included a bit further down in that same post.

  • I succeeded to imported , and it help in displaying full name of each assignee instead of user name by using static display of data.

    Now I have to find a way to display a status with "Assigned" instead of "0", and also to define the filter  on status level .

    Any idea about this? 

  • 0
    Certified Lead Developer
    in reply to natasav

    Thanks for confirming -- for statuses, you will need to manually define the status depending on its ID in sthe status column, as I don't know any built-in way in Appian to translate a status ID to the status name.  But as long as you can figure out what the different status IDs are, you should be good to go on that.

Reply Children
No Data