How to remove prefix value from group using wrapper

if(
  and(
    not(
      rule!APN_isBlank(
        ri!userId
      )
    ),
    isusernametaken(
      ri!userId
    )
  ),
  proper(
    concat(
      {
        user(
          ri!userId,
          "firstName",
          null
        ),
        " ",
        user(
          ri!userId,
          "lastName",
          null
        )
      }
    )
  ),
  if(
    isnull(togroup(ri!userId)),
  ri!userId,
  group(togroup(ri!userId), "groupName")
))
This is code. For this we will get below output. But we want to remove CR from output and display. How can we achive it

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    The "CR" prefix appears to be included in the actual Group Name, when the rule's input is a Group rather than a Username.  So, why not change the Group Name to not include that prefix, if it's not wanted in the group name output?  If this is not sufficient, can you go more into detail as to what it is you're trying to achieve here?

    Also as an aside, I'm unclear why it was necessary to include all 30-plus lines of code here (though, thanks for using a Code Box at least).  AFAIK the only relevant line of code here is, "group(togroup(ri!userId), "groupName")", which is just the normal use of the "group" function to return a Group's Name.

Reply
  • 0
    Certified Lead Developer

    The "CR" prefix appears to be included in the actual Group Name, when the rule's input is a Group rather than a Username.  So, why not change the Group Name to not include that prefix, if it's not wanted in the group name output?  If this is not sufficient, can you go more into detail as to what it is you're trying to achieve here?

    Also as an aside, I'm unclear why it was necessary to include all 30-plus lines of code here (though, thanks for using a Code Box at least).  AFAIK the only relevant line of code here is, "group(togroup(ri!userId), "groupName")", which is just the normal use of the "group" function to return a Group's Name.

Children