Problems with the Task Report Tutorial

I've been doing the Appian Task Report Tutorial for a while today and I just wanted to report a mistake in it. In the Format the Status Column tab it gives the following code:

a!forEach(
items: local!columnData,
expression: if(
local!configuredFormatting = "TASK_STATUS",
...
...

However since local!configuredFormatting hasn't been defined I think this should be:

with(
local!configuredFormatting: fv!item.configuredFormatting,
a!forEach(
items: local!columnData,
...
...

I'm also a little confused that it seems to have cut off preemptively when defining the filter without showing the code. I haven't been able to find a way to do this without assuming the column layout of the report analytic results, this is even called out in the tutorial previously when it mentions how hard coding is bad. What is the correct way to do this?

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Where they have:

     

    local!report: a!queryProcessAnalytics(
    report: cons!MY_TASKS_REPORT,
    query: a!query(pagingInfo: local!pagingInfo)
    )

     

    you'll want to the filter on the status column in the QPA like

    local!report: a!queryProcessAnalytics(
    report: cons!MY_TASKS_REPORT,
    query: a!query(
        /* don't filter if 0, which is the defauly value of the variable on load */
        filter:if(local!statusFilter=0,{},
            a!queryFilter(
                /* c5 is the status column in the tutorial I think */
                field:"c5","operator:"=",value:local!statusFilter
            )
        ),
        pagingInfo: local!pagingInfo
        )
    )
     

    I didn't actually run through the tutorial, so it might have some bugs but this is the direction I would go.

  • Yes, that was what I did in the end however I don't like that it's assuming the field will be c5 as its rigid in case someone changes the results. And that seems against the spirit of the tutorial.
    However the only way I can see of not assuming it is to query the task report once and the index it and use that to query again. Or to filter the data in Appian after its been queried.
    Since neither of those are Ideal I suppose best practice is to make filter columns C0 and just never add something to the left of them, that way their position will not change even if information is added or removed. But, as a baby Appian dev, I don't know how to make the task document so I don't know whether that is possible.
Reply
  • Yes, that was what I did in the end however I don't like that it's assuming the field will be c5 as its rigid in case someone changes the results. And that seems against the spirit of the tutorial.
    However the only way I can see of not assuming it is to query the task report once and the index it and use that to query again. Or to filter the data in Appian after its been queried.
    Since neither of those are Ideal I suppose best practice is to make filter columns C0 and just never add something to the left of them, that way their position will not change even if information is added or removed. But, as a baby Appian dev, I don't know how to make the task document so I don't know whether that is possible.
Children
No Data