Skip to main content
Inspiring
May 2, 2022 7:21 PM UTC
Solved

Expression evaluation error at function 'group' [line 13]: The passed parameter(s) are of the wrong type. Received the type List of Group.

I have created this rule to get the group names from my task report in a grid . but when there are multiple groups are present at assignee column, it gives error saying invalid group exception.

Here is the code:

 if(
  or(
    runtimetypeof(
      ri!groupOrUser
    ) = tointeger(
      'type!{http://www.appian.com/ae/types/2009}Group'
    ),
    like(
      ri!groupOrUser,
      "?Group:*"
    )
  ),
 touser(group(
    togroup(
      touniformstring(
        ri!groupOrUser
      )
    ),
    "groupName"
  )),
  rule!APN_displayUser(
    touser(
      ri!groupOrUser
    )
  )
)


Rule input-user or group

Any suggestions?

    Inspiring
    May 2, 2022 8:15 PM UTC

    yes i am using the similar rule.

    16 replies

    mikes0011
    Brainy
    May 2, 2022 7:24 PM UTC

    This is hard to read.  Could you edit your post and throw all that code in a Code Box, with indentation restored, etc?

    (edited to add: thanks! much better now.)

    The Expression Guru
    mikes0011
    Brainy
    May 2, 2022 7:31 PM UTC

    Also in case it helps, I have a similar task report which passes the value(s) in the "assignee" column into this rule, essentially "APN_displayGroupOrUser()", with a single rule input of type "user or group".

    if(
      runtimetypeof(ri!groupOrUser) = 'type!{http://www.appian.com/ae/types/2009}Group',
      if(
        isnull(ri!groupOrUser),
        null(),
        group(togroup(ri!groupOrUser), "groupName")
      ),
      rule!APN_displayUser(user: ri!groupOrUser)
    )

    The Expression Guru
    Inspiring
    May 2, 2022 7:44 PM UTC

    When there are list of groups like 2 groups  it doesn’t work . In expression rule it gives the group name for first group and at interface it through an error for invalid group exception

    mikes0011
    Brainy
    May 2, 2022 8:01 PM UTC

    Where and how are you trying to handle the assignee elements?  By default the report returns an array of assignment values (person or group), so in my interface I iterate over all such entries using a!forEach.

    The Expression Guru