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

Parents
  • @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.
Reply
  • @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.
Children
No Data