input :- test1 : "CRIS3-AB; CRIS3-AB; ; ; SOECS; SOECS; ; ", test2 : "; ; Related FOX; Related FOX; ; ; Trace; Trace", Desire output : " CRIS3-AB;CRIS3-AB;Related FOX; Related FOX; SOECS; SOECS; Trace; Trace"

There are 2 local variable:

local!test1 : "CRIS3-AB; CRIS3-AB; ; ; SOECS; SOECS; ; ",

local!test2 : "; ; Related FOX; Related FOX; ; ; Trace; Trace",

If no value available before semicolon symbol of local!test2 then a value from local!test1 should take place

Desire output : " CRIS3-AB;CRIS3-AB;Related FOX; Related FOX; SOECS; SOECS; Trace; Trace"

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    I am not sure how your description matches the desired output, but I got some code to share:

    a!localVariables(
      local!test1 : "CRIS3-AB; CRIS3-AB; ; ; SOECS; SOECS; ; ",
      local!test2 : "; ; Related FOX; Related FOX; ; ; Trace; Trace",
    
      local!test1Splits: split(local!test1, ";"),
      local!test2Splits: split(local!test2, ";"),
      if(
        a!isNullOrEmpty(local!test2Splits[1]),
        a!update(
          local!test2Splits,
          1,
          local!test1Splits[1]
        ),
        local!test2
      )
    )

Reply
  • 0
    Certified Lead Developer

    I am not sure how your description matches the desired output, but I got some code to share:

    a!localVariables(
      local!test1 : "CRIS3-AB; CRIS3-AB; ; ; SOECS; SOECS; ; ",
      local!test2 : "; ; Related FOX; Related FOX; ; ; Trace; Trace",
    
      local!test1Splits: split(local!test1, ";"),
      local!test2Splits: split(local!test2, ";"),
      if(
        a!isNullOrEmpty(local!test2Splits[1]),
        a!update(
          local!test2Splits,
          1,
          local!test1Splits[1]
        ),
        local!test2
      )
    )

Children