How to add or concatenate double quotes with String Variables?

I have a Row(“ColumnName1”), Row(“ColumnName2”) and Row(“ColumnName3”)as variables and I want to enclose them with double quotes. How do I do this?

Hi @wdescalsota

Row(“ColumnName1”) = “First”
Row(“ColumnName2”) = “Second”
Row(“ColumnName3”) = “Third”

Each variable with double quotes or as a whole string with double quotes

Like this “First”,“Second”,“Third”

or

Like this “First,Second,Third”

Replace
strText with Row(“ColumnName1”)
strText2 with Row(“ColumnName2”)
strText3 with Row(“ColumnName3”)

This syntax “”“” + strText + “,” + strText2 + “,” + strText3 + “”“” will return

image

This syntax “”“” + strText + “”“,” + strText2 + “”“,” + strText3 + “”“” will return

image

1 Like

I’m trying to generate an insert query using the Row(ColumnName) as data for the insert query

eg. Insert Into SAMPLETABLE (ColumnName1, ColumnName2, ColumnName3)
Values (Row(“ColumnName1”), Row(“ColumnName2”), Row(“ColumnName3”))

I’m getting slashes image when I try using image

the TestVar is = “123”

Like this “First”,“Second”,“Third”

You can replace the strtext with your variable as I said earlier… thanks

I’m getting slash when I tried the solution. image My assign is image and the default value is

Try using message box or log message because in local panel slash will come.

I tried them in write line activity and it seems to work fine, will this be applicable when I use it as sql query?

yes it will be work fine

but for sql query we have pass value into the single quotes right?

like some sort of conversion after the double quotes?

Could you explain in detail I couldn’t understand the context correctly…

like, there will be some replacement of double quotes into single quotes? was referring to your last message regarding the pass value into single quotes.
You may expound it better so I may understand better

what my workflow would be is that after extracting data from the excel file, I’ll make an insert query and using the gathered data, those will be set as the values that will be enclosed in double quotes. and after applying the double quotes. will use the created string to an execute query activity

Hi,
if number of variables are the same, you can try:

output = String.Format("""{0}"",""{1}"",""{2}""", var1, var2, var3)

Output:
image

1 Like

will this be safe to use in an execute query activity?

strVar1=row(“columnName1”).Tostring
strVar2=row(“columnName2”).Tostring
strVar3=row(“columnName3”).Tostring

Assign Activity
strVar=strVar1+strVar2+strVar3
message box
“”" +strVar+“”"

I am using String.Format () in SQL and REST API queries. Everything is OK.