Yes you can use a variable insid a string with a method called format
Say if you have string variable like
Intext = “my name is JCH”
Here if you want to replace JCH with a variable…
You have to first make the intext like this
Intext = “my name is {0}”
Where {0} is the place holder where you are to pass the name as a variable…
How…?
Say you have a variable named of string type
Inname = “JCH”
NOW to place this inname variable in that place holder of intext we can do like this
String.Format(intext,inname)
Thanks for your response @Palaniyappan !
That’s different that what I was thinking. I will give that a try.
I thought that you can just put “text … {variable}… more text” in quotations as usual, and then inside that text surround your variable between + or ’ or something. Saves you having to create variables for every response type.
Here’s an example of what I was thinking. Except I can’t get it to work
Thanks @Sharan75. I think what’s causing my problem is the enter in my text. When I remove the enter it’s fine. If I leave the enter, I get an error "String constants must end with a double quote.
Getting a bit precise, but I’d like it to be a nice format for the people to read this email.
It’s interesting because enters are fine if you don’t use any variables. But as soon as you add a variable, it comes up with an error: String constants must end with a double quote.
If I remove the enter, error goes away. Press enter, error comes back. Is that normal?
Thanks @Palaniyappan, I’m going to have multiple different emails going back to the users depending on what the situation is. Ideally I’d like to just be able to type that into the body section of the mail activity and avoid having to create a bunch of variables to cover each email text.
Hi! Hope you guys can help me. I have a similar 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.”
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, 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 help me with a solution? Thanks!