Add task report filters to user interface

Certified Associate Developer

Hi Team
I have an existing report, "All Tasks", which is an ARF file, of course.

I am able to configure filters on the report to customise the report.

My requirement is to show the report in a UI so a team lead can see what tasks have been, by whom, whether it is complete, and the duration of the task.

Downloading the report and converting it to Excel is not an option - the requirement is to view the report on my site.

I have an interface with a read-only grid that returns exactly the information required.

Is it possible to add filters to a report backed UI?

If so, how do I go about it?

Thanks and blessings

Stephen

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    a!queryProcessAnalytics has a query parameter in which you can feed filters and logical expressions.

  • 0
    Certified Senior Developer

    Hi, yes can create dropdown for the filters. For column Claimed a dropdown filter can be created and the value of it can be passed to the filters of queryProcessAnalytics, then the data you will get will be filtered on passed value. Let us know if you have any queries.

  • 0
    Certified Senior Developer

    Hi  

    Please go through the link here, It has the pattern from which you can get inspiration.

  • 0
    Certified Associate Developer
    in reply to Sri Ram Kaja

    I have followed all the steps listed here:


     https://appianspace.com/2023/06/29/showing-tasks-on-the-site/

    but am getting the following error:


    errorMessage"The report column specified for the additional filter is not available. (APNX-1-4156-001)"(Text)

    The column does exist and should be available, so I'm a bit stumped.

     , can you shed any light on this?

  • 0
    Certified Lead Developer
    in reply to Stephen Kane

    We can only say anything after looking at all the details that you can share.

  • 0
    Certified Associate Developer
    in reply to Stefan Helzle

    a!localVariables(
      local!datasubset: rule!AT_processTaskReport(
        taskName_txt: ri!taskName_txt,
        status_int: ri!status_int,
        owner_txt: ri!owner_txt,
        assignee_txt: ri!assignee_txt
      ),
      a!sectionLayout(
        label: "",
        labelColor: "SECONDARY",
        contents: {
          rule!APP_uiInterfaceHeader(text: "Tasks Overview"),
          a!sectionLayout(
            label: "",
            contents: {
              a!gridField(
                label: "",
                emptyGridMessage: "No task history available",
                data: local!datasubset.data,
                columns: {
                  a!gridColumn(
                    label: "Reference Number",
                    sortField: "",
                    value: fv!row.c1
                  ),
                  a!gridColumn(
                    label: "Task Name",
                    sortField: "",
                    value: fv!row.c2
                  ),
                  a!gridColumn(
                    label: "Assigned On",
                    sortField: "",
                    value: text(fv!row.c6, "D MMM YYYY, HH:MM")
                  ),
                  a!gridColumn(
                    label: "Assigned To",
                    sortField: "",
                    value: a!richTextDisplayField(
                      value: {
                        a!localVariables(
                          local!showGroupMembers,
                          local!group: if(
                            a!isNullOrEmpty(togroup(fv!row.c14)),
                            null,
                            a!groupMembers(togroup(fv!row.c14)).data
                          ),
                          local!groupMembers: if(
                            a!isNullOrEmpty(local!group),
                            null,
                            a!forEach(
                              items: local!group,
                              expression: a!richTextItem(
                                text: joinarray(
                                  {
                                    user(fv!item, "firstName"),
                                    user(fv!item, "lastName")
                                  },
                                  " "
                                )
                              )
                            )
                          ),
                          {
                            a!richTextItem(
                              text: rule!APP_displayUserOrGroup(fv!row.c14) & "  "
                            ),
                            a!richTextIcon(
                              icon: if(
                                isnull(local!showGroupMembers),
                                "expand",
                                "compress"
                              ),
                              caption: if(
                                isnull(local!showGroupMembers),
                                "Expand group",
                                "Collapse group"
                              ),
                              link: a!dynamicLink(
                                saveInto: if(
                                  isnull(local!showGroupMembers),
                                  a!save(local!showGroupMembers, true),
                                  a!save(local!showGroupMembers, null)
                                )
                              ),
                              showWhen: a!isNotNullOrEmpty(togroup(fv!row.c14))
                            ),
                            a!richTextBulletedList(
                              items: local!groupMembers,
                              showWhen: a!isNotNullOrEmpty(local!showGroupMembers)
                            )
                          }
                        )
                      }
                    )
                  ),
                  a!gridColumn(
                    label: "Claimed By",
                    value: a!richTextDisplayField(
                      value: a!richTextItem(
                        text: a!defaultValue(
                          rule!APP_displayUserOrGroup(fv!row.c14),
                          "-"
                        )
                      )
                    ),
                    align: "CENTER"
                  ),
                  a!gridColumn(
                    label: "Started On",
                    sortField: "",
                    value: text(fv!row.c7, "D MMM YYYY, HH:MM")
                  ),
                  a!gridColumn(
                    label: "Completed On",
                    sortField: "",
                    value: if(
                      a!isNullOrEmpty(fv!row.c8),
                      "Not Completed",
                      text(fv!row.c8, "D MMM YYYY HH:MM")
                    )
                  ),
                  a!gridColumn(
                    label: "Task Duration",
                    sortField: "",
                    value: with(
                      local!interval: tointervalds(fv!row.c9),
                      local!days: tointeger(
                        split(tostring(local!interval), "::")[1]
                      ),
                      local!hours: tointeger(split(tostring(local!interval), ":")[3]),
                      local!minutes: tointeger(split(tostring(local!interval), ":")[4]),
                      local!seconds: tointeger(split(tostring(local!interval), ":")[5]),
                      if(
                        local!days = 0,
                        "",
                        local!days & if(local!days = 1, " day, ", " days, ")
                      ) & if(
                        and(local!days = 0, local!hours = 0),
                        "",
                        local!hours & if(local!hours = 1, " hour, ", " hours, ")
                      ) & if(
                        and(
                          local!days = 0,
                          local!hours = 0,
                          local!minutes = 0
                        ),
                        "",
                        local!minutes & if(
                          local!minutes = 1,
                          " minute, ",
                          " minutes, "
                        )
                      ) & local!seconds & if(local!seconds = 1, " second", " seconds")
                    )
                  )
                }
              )
            }
          )
        }
      )
    )

  • 0
    Certified Lead Developer
    in reply to Stephen Kane

    The reason could be that you have provided the wrong column number there. Try to identify the correct column number (c0, c1, etc) from the data set returned by queryProcessAnalytics and then mention it in the q!queryFilter's field property. 

  • 0
    Certified Lead Developer
    in reply to Stephen Kane

    You are aware that the code of interest is inside "AT_processTaskReport"?

  • 0
    Certified Associate Developer
    in reply to Harshit Bumb (Appyzie)

    That is what is puzzling me - without the secondary filter the return I get is this:

    Value

    Formatted
    Raw
    Expression
    • PortalReportDataSubset
        • startIndex1(Number (Integer))
            • batchSize100(Number (Integer))
                • sortList of SortInfo - 1 item
                    • SortInfo
                        • field"c14"(Text)
                            • ascendingfalse(Boolean)
                            • totalCount33(Number (Integer))
                                • dataList of Dictionary - 33 items
                                  • identifiersList of Number (Integer) - 33 items
                                    • name"SAM Task Overview"(Text)
                                        • description"A report of all software asset management application tasks"(Text)
                                            • columnConfigsList of Dictionary - 9 items
                                                • Dictionary
                                                    • label"Task Name"(Text)
                                                        • field"c2"(Text)
                                                            • drilldownField"dp2"(Text)
                                                                • configuredFormatting"NORMAL_TEXT"(Text)
                                                                    • configuredDrilldownnull(Text)
                                                                      • Dictionary
                                                                          • label"Status"(Text)
                                                                              • field"c5"(Text)
                                                                                  • drilldownField"dp5"(Text)
                                                                                      • configuredFormatting"TASK_STATUS"(Text)
                                                                                          • configuredDrilldownnull(Text)
                                                                                            • Dictionary
                                                                                                • label"Assignees"(Text)
                                                                                                    • field"c14"(Text)
                                                                                                        • drilldownField"dp14"(Text)
                                                                                                            • configuredFormatting"USER_OR_GROUP_NAME"(Text)
                                                                                                                • configuredDrilldownnull(Text)
                                                                                                                  • Dictionary
                                                                                                                      • label"Assigned On"(Text)
                                                                                                                          • field"c7"(Text)
                                                                                                                              • drilldownField"dp7"(Text)
                                                                                                                                  • configuredFormatting"DATE_TIME"(Text)
                                                                                                                                      • configuredDrilldownnull(Text)
                                                                                                                                        • Dictionary
                                                                                                                                            • label"Started On"(Text)
                                                                                                                                                • field"c6"(Text)
                                                                                                                                                    • drilldownField"dp6"(Text)
                                                                                                                                                        • configuredFormatting"DATE_TIME"(Text)
                                                                                                                                                            • configuredDrilldownnull(Text)
                                                                                                                                                              • Dictionary
                                                                                                                                                                  • label"Completed On"(Text)
                                                                                                                                                                      • field"c8"(Text)
                                                                                                                                                                          • drilldownField"dp8"(Text)
                                                                                                                                                                              • configuredFormatting"DATE_TIME"(Text)
                                                                                                                                                                                  • configuredDrilldownnull(Text)
                                                                                                                                                                                    • Dictionary
                                                                                                                                                                                        • label"Task Duration"(Text)
                                                                                                                                                                                            • field"c9"(Text)
                                                                                                                                                                                                • drilldownField"dp9"(Text)
                                                                                                                                                                                                    • configuredFormatting"DURATION"(Text)
                                                                                                                                                                                                        • configuredDrilldownnull(Text)
                                                                                                                                                                                                          • Dictionary
                                                                                                                                                                                                              • label"Reference"(Text)
                                                                                                                                                                                                                  • field"c1"(Text)
                                                                                                                                                                                                                      • drilldownField"dp1"(Text)
                                                                                                                                                                                                                          • configuredFormatting"NORMAL_TEXT"(Text)
                                                                                                                                                                                                                              • configuredDrilldownnull(Text)
                                                                                                                                                                                                                                • Dictionary
                                                                                                                                                                                                                                    • label"DCM Case ID"(Text)
                                                                                                                                                                                                                                        • field"c17"(Text)
                                                                                                                                                                                                                                            • drilldownField"dp17"(Text)
                                                                                                                                                                                                                                                • configuredFormatting"NUMBER"(Text)
                                                                                                                                                                                                                                                    • configuredDrilldownnull(Text)
                                                                                                                                                                                                                                                    • errorMessagenull(Text)




                                                                                                                                                                                                                                                • 0
                                                                                                                                                                                                                                                  Certified Lead Developer
                                                                                                                                                                                                                                                  in reply to Stephen Kane

                                                                                                                                                                                                                                                  Can you please add the code inside AT_processTaskReport?