I have a problem with showing the proper info in a portal report that shows all the active tasks.

Hi,
I have a problem with showing the proper info in a portal report that shows all the active tasks. The problem is when the task is assigned to a group. At that point, the task is not shown to who it's assigned. A have created a rule to solve this issue:

=if(find("Group", tostring(ri!user)) <>0, getdistinctusers(ri!user), ri!user)

This rule works fine when tested as a rule (it expects an array of users or groups, and returns all the distinctive users that are specified + the users that are in the specified groups).
But when I use this rule in the report, it doesn't work - it shows a null value to whom the task is assigned.
That is my first problem.

My second problem is within my process model. I am trying to filter the report (from above) according to the user who started the process using the "Execute Process Report" node.
Here is how the "Additional Filter" is defined:
Assigned To =pv!requestor

When the task read from the report is assigned to a si...

OriginalPostID-204603

  Discussion posts and replies are publicly visible

  • ...ngle user, then the filter (defined as above) works fine, but when the task is assigned to multiple users, it doesn't work - so I thought that I should change the way I defined the "Additional Filter" to:
    Assigned To LIKE pv!requestor

    But this way, I get all the data from the report (they are not filtered at all).
    Just to clarify, "pv!requestor" is the user that starts the process, and "Assigned To" is the column read from the report (the users to whom the task is assigned to).

    Do you have any idea how to solve my two problems - the one in my report (how to show users from a group in a filed), and the other one in my process model (with the proper definition of the additional filter)?

    Thank you in advance...
    BR, Bojan
  • For the first part of your issue, have you had a look at this post and the attached code? forum.appian.com/.../e-199642
  • Yes, but this is a manual for creating a Tempo Report... I need a solution using a Portal Report. Any ideas?
  • I was thinking you could use a similar rule as part of the portal report data.
  • Hi bojanb,
    Regarding your second problem wherein you are not able to bring in the report entries where the task assignees can be multiple, this is how you can handle

    In the portal report itself under the column assigness, you can apply the joinarray function to append the array with semicoln(;) to have a single string followed by appending ";" in the last, ie
    =joinarray(pv!Assigness,";") & ";"

    Now in the process model when you are using Execute process report smart node to read the above report in the additional filter section, while you are passing the requestor name (which in you case in the user who intiated the process) before passing that pv! in this additional filter section, in the script task modify this pv to: ";" & pv!requestor & ";" and use the result of this in your Value field of the additional filter.

    This way lets say your assignees in report have value B;BC;CD;DE;
    and your requestor is B then value you will be passing is B; which using 'LIKE' operator will return true and will bring that row in the process back.

    Hope this helps.
  • @bojanb My solution is with regards to your first problem. You need to bear in mind that few categories of functions (namely Looping Functions, Scripting Functions and Evaluation Functions) won't work in Portal Reports. As per the expression you have been using, getdistinctusers() falls under Scripting Functions.

    At a high level, I understand that you are making use of 'Execute Process Report' smart service to retrieve the data in a process, so you may not need a Tempo Report. So what you can do here is, in the outputs of the smart service, format the data (You may use the rule at the post pointed out by @philb earlier) that is obtained from results of smart service via ACPs and store it in the target PVs.

    I will comment on your second problem shortly. Meanwhile it would be grateful if you can let us know the version of Appian you are working on and the category of Report (i.e. Tasks Per Process Model, Tasks Per Process) you have chosen.
  • The current version of Appian is 7.8, the Report Type is "Task" and the Context Type is "Tasks by Process Model".
    Thank you for all the ideas and info...
  • @siddharthg837 & @philb
    I tried your advice, but it didn't work. I changed the value "Assigned To" from the portal report to: joinarray(tp!Assigness,";") & ";"
    In the process model, in the script task, I modified the pv!requestor to ";" & pv!requestor & ";" - but this way no value was found. I then changed it to: pv!requestor & ";" (without the first ";") and it found results from tasks assigned only to single user (the requester). The parallel tasks were not found.


    @sikhivahans
    Can you please guide me a little bit more how to configure the output of the "Execute Process Report" for the value "Assigned To". As I mentioned before, I need to show the distinctive users to whom the task is assigned to (users + the users from the group to whom the task is assigned to).

    Thank you again...
    BR, Bojan
  • @bojanb Hi, I have attached a code snippet which you can actually start playing with. It aids you with the capability of querying the tasks where the user is directly part of (assigned to user directly) or indirectly part of(as you know already, when the user is a part of the group, he/she will be assignee when the group is assigned a task) or when the user is assigned the task along with other users or groups. To the best of my knowledge, this resolves your second problem. Please feel free to let us know in case if you have any follow up questions.

    With regards to your first problem, I don't think you can surface the users from a group in the portal report. But let me still explore the possibility mean while.