Groups assigned for a task are displaying as [Group:102] rather than Group name

I tried searching Forum already but did not find solution for this. I am following current best practices and using a!queryProcessAnalytics to display a Portal Report in Tempo, however the Groups assigned for a task are displaying as [Group:102] rather than Group name.

I am following the R7.9 Task Report Tutorial which does include how to do special handling for Task Status and Task Details, but for some bizarre reason not Task Assigned Groups. It can not be handled they way Status and Details are as there is no special column config formatting for groups as it is text.

Please help. Thanks.

OriginalPostID-150105

OriginalPostID-150105

  Discussion posts and replies are publicly visible

  • @greggl Please find attached the text file which has a rule that will help you in formatting the User or Group data, the column in the portal report holds.

    I hope the attached definition helps you to some extent.

    Format user or group object of portal report data.txt

  • Thanks for this! I actually am using this rule in another application and works fine when the column with user or group data is known. However I am trying to adapt it to the R7.9 Task Report Tutorial which uses the different configuredFormatting values with If() functions to format the data types. See the portalReportColumn() rule below. And as queryProcessAnalystics() does return a specific formatting type for user or groups names (configuredFormatting:USER_OR_GROUP_NAME), so all I think that is missing is an If() function to check for this configuredFormatting type which then calls the rule!getFormattedUserOrGroupName. But I can not get that working with below rule. Any ideas? Thanks!

    with(
    local!columnData: index(ri!data, ri!columnConfig.field, {}),
    local!columnDataCount: count(local!columnData),
    a!gridTextColumn(
    label: ri!columnConfig.label,
    field: ri!columnConfig.field,
    data: if(
    local!columnDataCount > 0,
    apply(
    if(
    ri!columnConfig.configuredFormatting = "TASK_STATUS",
    rule!AT_getTaskStatusDisplay(data: local!columnData, index: _),
    rule!AT_displayTextCell(data: local!columnData, index: _)
    ),
    1 + enumerate(local!columnDataCount)
    ),
    {}
    ),
    links: if(
    ri!columnConfig.configuredDrilldown = "TASK_DETAILS",
    apply(
    a!processTaskLink(task: _),
    index(ri!data, ri!columnConfig.drilldownField, {})
    ),
    null
    )
    )
    )

  • I am trying this below but it's not working. rule!displayTextCell referenced is just tostring(ri!data[ri!index]). In this approach I am doing the toString first on returned data then passing that to the rule!getFormattedUserOrGroupName. Perhaps that is not the right approach?

    if(ri!columnConfig.configuredFormatting = "USER_OR_GROUP_NAME",
    apply(
              rule!getFormattedUserOrGroupName(userOrGroup:_),
    rule!displayTextCell(
    data: local!columnData,
    index: _
    )
    ),
  • @greggl Could you please try following snippet:

    if(
    ri!columnConfig.configuredFormatting = "USER_OR_GROUP_NAME",
    apply(
    rule!getFormattedUserOrGroupName(
    userOrGroup: _
    ),
    local!columnData
    )
    )

    Few things to note:
    1. As already discovered by you, there is no need of converting the data into text by using rule!displayTextCell(). Because first of all, we should actually capture the data given by Appian in a specific format without modification, especially in case of User or Group/ Group objects. If you convert the data before hand into string, there after converting back into User or Group object, and then split the values into User objects and Group objects may not be possible.

    if(
    ri!columnConfig.configuredFormatting = "USER_OR_GROUP_NAME",
    apply(
    rule!getFormattedUserOrGroupName(
    userOrGroup: _
    ),
    local!columnData
    )
    )

    2. There isn't a need of using rule!displayTextCell() finally because the same functionality is already done by getFormattedUserOrGroupName in the last step using joinarray which converts an array into string with the desired separator.

    3. I would like to suggest to maintain the user object or group object (For instance, task assignees, task owners, task assignee owner etc) in portal reports in 'User or Group' format i.e. configure the type of the column in the portal report as 'User or Group'. This simplifies the read operations as well as modifications (For instance, formatting a task owner to display first name and last name or converting the task assignees (combination of user objects and group objects) to their respective formatted names) at a later stage.

    4. The intention of rule!displayTextCell() is to convert an array of values which a record holds for an attribute, to plain text. This is to avoid the mismatch in the number of rows raised in case of flattening of arrays. It isn't necessary to use this rule finally as a wrapper, infact your formatted rule (for instance, getFormattedUserOrGroupName can take care of this conversion and infact we can add the desired separators as well) can take care of the conversion.


    Please do let me know if you have any follow-up questions.
  • Added to the above,

    5. Please make sure that the data of type 'User or Object' is passed as 'Any Type' to the formatting rule. Because I have observed that the 'User or Group' data is retrieved as 'Any Type' by a!queryProcessAnalytics. So your formatted rule should also accept the data in form of 'Any Type' input, else you can't make use of the data if you assume that you get 'User or Group' type data. That's the reason why I have set the data type of input to 'Any Type' in the definition attached by me in the previous comments.
  • Hello,
    I am using your rule and snippet in the attached sail (lines 30-38), but getting the following error:
    Could not display interface. Please check definition and inputs.
    Interface Definition: Expression evaluation error in rule 'getformatteduserorgroupname' (called by rule 'portalreportcolumn') at function 'touser' [line 8]: Could not cast from Group to User. Details: CastInvalidCould not cast from Group to User. Details: CastInvalid.

    Any help would be greatly appreciated! I am just trying to get a Group to display right in Tempo. Thanks!

    portalReportColumn.txt

  • @greggl Hi, May I please know if the code attached by you has all the contents or did you remove some intentionally before attaching the file? Because I could see that the apply function is syntactically wrong. I could help you out if you could let me know what you are trying to do by using apply so that I could try to give some recommendation.
  • Hey, it is that full rule. There are other components, like your rule that's called, but it is that rule. It works fine when I remove the If clause, lines 30-38, trying to use your rule to format the Group in Tempo. If you could post the right syntax for those lines, or the whole rule, that would be great.
  • Could you please try the code as attached in the snippet? Please do let me know if you have any issues.

    portalReportColumn.txt