Variable within email body not returning value

Hi! Hope you guys can help me. I case where I am calling a variable within a text body of an email. I’m using the syntax: “This is a " +variable+ " in this sentence.” The text body is being created in ServiceNow.

When I assign a static value in the variable (of type TEXT), it puts in the value. But when I assign the variable’s value via Get Text for example, it doesn’t put the value when the variable is called in the email body. I tried returning the value via Log Message and it puts in the value but when I call the variable in the email body, it returns nothing.

Appreciate if you can share your thoughts or solution? Thanks!

Hi @eph.rosal

I wonder if it is work to use variable.toString instead of variable.

1 Like

@eph.rosal Also check if you have two variables having the same name and make sure the variable is of the type String.

1 Like

Thanks! I know I tried that one in passing but let me try that approach again and let you if that fixes it.

Thanks! Let me double check these and let you know.

1 Like

@eph.rosal Also check the Scopes of the variables, Assign the Outer most Scope.

1 Like

I am having literally this exact problem. I made sure to set the scope of the variable whose name is in the email text to “Sequence”, the highest possible, but the variable’s value won’t show up in the email draft. What am I doing wrong?
image