Expression rule

Certified Associate Developer

How to write a rule which takes two input a char and an integer,
ruleInput: (A,2)
Output: (A1;A2) 

anyone can give me the answer 

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    How are you passing this value?

    Also as Yogi Patel mentioned create a Rule input of text type and try this.

    a!localVariables(
      local!value: ri!ruleInput,
      local!integer: cleanwith(local!value, "1234567890"),
      local!alphabet: stripwith(local!value, "123456789(),"),
      local!listOfInt: enumerate(tointeger(local!integer)) + 1,
      a!forEach(
        items: local!listOfInt,
        expression: concat(local!alphabet, fv!item)
      )
    )

    I would ask you to please share what you have tried and what exactly is the requirement. 

Reply
  • 0
    Certified Senior Developer

    How are you passing this value?

    Also as Yogi Patel mentioned create a Rule input of text type and try this.

    a!localVariables(
      local!value: ri!ruleInput,
      local!integer: cleanwith(local!value, "1234567890"),
      local!alphabet: stripwith(local!value, "123456789(),"),
      local!listOfInt: enumerate(tointeger(local!integer)) + 1,
      a!forEach(
        items: local!listOfInt,
        expression: concat(local!alphabet, fv!item)
      )
    )

    I would ask you to please share what you have tried and what exactly is the requirement. 

Children
No Data