Need to know how can I add a string "Ashish" to a variable name that it's value would be :
Name (datatype text) = "Ashish" (value)
as Name = ""Ashish"" would not work for obvious reasons.
Thanks
Hi,
If you want to do something with a variable that don't have quotes and want to add to it, you can do like this to:
The principle is the same that Nordin and Maycon told here, but with variables.
Regards,
Ricardo
Hi Ashish,
Try Name = """Ashish""" (So three double quotes)
Kind regards,
Nordin
When you put two double quotes the expression validator will understand you are trying concatenate a blank space plus Ashish variable plus a blank space, but it's not validate because there are no the plus (+) between then.
If you put three quote, like Nordin said, expression will be validate.
I hope helped you.
Best regards
Maycon Silva
Hey All
Thanks for your inputs I do realize that the two double quotes in the start give it a empty string that is up for a concatenation, I actually am trying to run an API in which, in the onBeforeRequest action need to append the JSON for payload to the CustomisedRequest.Text and since the JSON always has double quotes I am not sure how to pass them. I would love to give more inputs if needed.
Thanks for all your answers!!
Cheers
Ashish Sarwal wrote:
Hi Ashish did you get a resolution. If so please can you share.
If you search the forum you will notice this question asked multiple times and with answers nsrked as solution.
With literal strings you put two double quotes for every single one.
Daniel
No, this doesn't actually work
It returns this
And I want this ""999999999"",
How do you do that^^^^???
Hi Michael,
Design:
Runtime:
Result Output textbox:
are you expecting this?
Thanks,
Balu
No, the output string in the debugger has to look like this ""999999999"". This is for a Restful api json request that requires the variable to be enclosed in double quotes. The text variable has to be stored with single quotes like this: "999999999", then when it is sent it will be received like this ""999999999"". That's what we can't get it to do.
To simplify
" ' " gives single quote( ' ) in string
" "" " gives double quote( " ) in the string
Now you should try the combination you need. Posting late, just for new people who may land on this post.
Hello all! I followed this, but using """" is giving me 2 double quotes instead of one.
Any ideas?
Hi Vinicius,
For 1 double quote you can follow below format :If you want to show text as "Vinicius" then write
""""+"Vinicius"+""""
And if you want to show text from any variable then write,
""""+Test+""""
where Test variable will have text value.Hope this will resolve your query.Regards,
Rashmi
You can use CHR(34), for example
for the text: "expression" you can do this CHR(34)+ "expression"+ CHR(34) and the result will be
"expression".
Let me know if worked for you
I passed the same few days ago and the debugger was my best friend :) To add a single quote or 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>