I have a assignees column in task portal report which may have multiple values.

I have a assignees column in task portal report which may have multiple values. When I convert it to a sail report, get an exception. I tried to convert the assignees into a text by using joinarray(doforeach(rule!getDisplayNameForUserOrGroup, tp!assignees), ",") but it was not working. Any idea?

at function a!gridField [line 28]: A grid component [label=“”] has an invalid value for “totalCount”. “totalCount” must not be null or less than the number of items in any of the “data” arrays, but “totalCount” was 1 and the largest column data array had 2 items. (APNX-1-4218-025)

OriginalPostID-188719

OriginalPostID-188719

  Discussion posts and replies are publicly visible

  • @shaoyongw I have attached the definition of a rule which I have written some time ago and this will give you an idea of formatting User or Group attributes such as tp!assignees. Further I would like to suggest to depend on Appian's looping functions found at https://forum.appian.com/suite/help/7.11/Looping_Functions.html rather than doforeach(). The rule which I have specified should be iterated over each element in the tp!assignees column, i.e. apply(rule!AT_getUserOrGroupDisplay,tp!assignees) or doforeach(rule!AT_getUserOrGroupDisplay,tp!assignees). Also please make a note that the data type of the input of rule!AT_getUserOrGroupDisplay is 'Any Type'.

    Re your implementation, if your code i.e. joinarray(doforeach(rule!getDisplayNameForUserOrGroup, tp!assignees), ",") is being invoked directly over the entire tp!assignees dataset, then this leads to an error. Because each element in the dataset is able to hold multiple values, so the formatting rule which we create should be applied over each element in the dataset, and the formatting rule should internally handle the concatenation of multiple values. For example, doforeach(rule!getDisplayNameForUserOrGroup, tp!assignees) should be the final rule which we invoke over tp!assignees and rule!getDisplayNameForUserOrGroup should take care of concatenation using joinarray().

    It would be grateful if you can attach the code as the practitioners might give their opinions or suggestions if they feel that something is wrong with the code.
  • hi sikhivahans, forget to mention, I was doing the format stuff in the portal report data definition. It throws exceptions as I mentioned in the question if I didn't do anything when convert it to sail report. It seems the assignees have to be formatted as a text before converting to sail report. I am having issues when formatting these assignees. The functions are not working right now. One weird thing I found is, length(tp!assignees) returns null but count(tp!assignees) returns 2. The tp!assignees do contain two groups.
  • @shaoyongw I would like to suggest to apply the formatting after obtaining the data from portal report. This means that I would like to suggest to refrain from doing the conversion in portal report because very few functions work in portal report and also Appian has specified the same in the documentation that some functions, for instance scripting functions in particular won't work in portal report.

    Further I would like to suggest to check if there is a problem with any other columns other than this tp!assignees. If you are doubtful regarding the source of error, please go ahead with attaching the code here so that the practitioners can throw light on the error.
  • Can you please attach the SAIL for your task report and for rule!getDisplayNameForUserOrGroup?