Skip to main content
May 2, 2022
Solved

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

  • May 2, 2022
  • 16 replies
  • 0 views

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?

    Best answer by gaganpreetk0002

    yes i am using the similar rule.

    16 replies

    mikes0011
    Brainy
    May 2, 2022

    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.)

    mikes0011
    Brainy
    May 2, 2022

    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)
    )

    May 2, 2022

    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

    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.