Skip to main content
September 4, 2023
Solved

how to combine two text local variables

  • September 4, 2023
  • 8 replies
  • 0 views

Hi I am Learning Appian development, i have doubt how to combine two text local variables please hep me on this

a!localVariables

(

localVar1: Text := "Hello,",

localVar2: Text := " World!" )

local!combinedText := local!localVar1 & local!localVar2

Best answer by venkatb0004

Hi Thanks for your support,

i want to learn more things in Appian

So requesting you to help me more thanks in advance

8 replies

anmolv0003
September 4, 2023

a!localVariables(
  local!Var1 : "Hello,",
  local!Var2 : "World!",
  local!combinedText : local!Var1 & local!Var2, 
  /*or*/
  /*local!combinedText : concat( local!Var1,local!Var2),*/
  local!combinedText
)

You can use the & operator or you can use concat() function

Also : 

stefanhelzle0001
September 4, 2023

Using "&" inside concat() is nonsense. Concat takes any number of parameters. I changed this in my example below.

And there is no need to declare a local variable just to define the output of an expression. I see that a lot recently and really wonder where this is coming from.

a!localVariables(
  local!Var1 : "Hello,",
  local!Var2 : "World!",
  
  concat(local!Var1, local!Var2)
)

anmolv0003
September 5, 2023

Thank You , by mistake I typed it.

mathieud0001
September 4, 2023

I personally recommend using concat() to concatenate text together simply because it is easier to collapse/uncollapse in the expression editor.

November 9, 2023

We can use concat() function in which we need to wrap both the local variables local var1 and local var2 in concat() function and for the spacing in between we can use char(32). for ex:- concat(localvar1,char(32),localvar2).