Skip to main content
June 3, 2022
Question

How to remove prefix value from group using wrapper

  • June 3, 2022
  • 5 replies
  • 0 views

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

    5 replies

    mikes0011
    Brainy
    June 3, 2022

    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.

    The Expression Guru
    June 6, 2022

    I want group name as exactly the same thing, But while printing out the group name prefix should be removed

    manishk0011
    June 6, 2022

    I believe you wanted to show this group name in interface , As the return type of your code is just a text , why don't you just replace the CR using appian function ? or you have some other requirement?