Hello,
I have a problem wanting to send a quoted string. I wanted to add a variable between quoted text to send to a service I have. Can anyone help me? I leave an example.
Regards,
Jorge Rodrigues
Hello Jorge again,
It´ s the same think in Tradicional and Reactive, you should use double quotes, for example like this:
"""" + VarTXT + """"
Hope it helps,
Nuno R
Hi Nuno,
I tried that way and it didn't work.
Hello @Jorge Rodrigues ,
The example that you give in the begin works :).
This new one I think is a different case, can you share an OML?
Best Regards,
I was doing something wrong, you were right Nuno. Thank you very much.
Hello @Jorge Rodrigues ,It´´´ s Tradicional or Reactive?
Best Regards,Nuno R
Hello @Jorge Rodrigues,
Nuno already said it. I'll add if you want just a single quote around the text, do the following:
"'" + VarTXT + "'"
Best,
Frederico
Thanks for the time available, but Nuno's answer was just what I wanted.
Hi,
if you want the result like this "VarTXT", then you can use this """"+VarTXT+"""", no need the backslash, such as belows:
@Jorge Rodrigues , to add a single quote (or in your case, a double quote for HTML attributes) within a string in OutSystems, you need to "escape" it.
Here's how it works:
Example from my code:
"<p style= " +""""+ " display: flex;justify-content: center;" +""""+ ">"
In short, use """" whenever you need to insert a quotation mark within a string in OutSystems.Debugging:This was what I have in the Assign:"<p style= " +""""+ " display: flex;justify-content: center;" +""""+ "> <img style= " +""""+ " display:" +""""+ "block;width:200px;height:200px;display:inline-block;" +""""+ " id=" +""""+ "base64image" +""""+ " src=" +""""+ "data:image/png;base64, " + EncodeHtml(BinaryToBase64.Base64) + " " +""""+ "> </p>" this is after the Assign:
<p style= " display: flex;justify-content: center;"> <img style= " display:"block;width:200px;height:200px;display:inline-block;" id="base64image" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUg..."></p>