1.I have datatable from column “GL Text” in which having value (“TAXS” test.test2.bb)
-while reading datatable value is getting changed to
[GL Text
“”“TAXS”" test.test2.bb"
]
2.Reading the column = dtOutput.DefaultView.ToTable(False,“GL Text”)
3.converting the dt to string using output datatable activity
4.removing the header value = strOutput.Remove(0, strOutput.IndexOf(Environment.NewLine)+2)
-double quotes are getting added while converting the dt to string
@“”“”“”“TAXS”“”" test.test2.bb""
"
5.Set to clipboard and paste the value to SAP. value which should be pasted in sap is = “TAXS” test.test2.bb
In the same manner if your datatable is from excel and you knw the cell address you can fetch it. If the datatable is dynamic you can use a for loop and an if condition to assign a varaiable with the value of the cell.
And could you please check the same way I am doing -
1.reading from DT
2.convert it into string
3.copy it to set to clipboard and
4.then paste it to notepad.
If you want a double quote to be part of the variable’s value (e.g., a string containing a quote), you need to escape it. UiPath uses double quotes itself to define strings, so a single double quote within the string would be interpreted as the end of the string. Here’s how to escape it:
Double the double quote: You can simply use two double quotes together (“”). For example, if you want a variable named “message” to hold the value “This is a message with a quote “inside” it.”, you would assign it like this:
message = "This is a message with a quote ""inside"" it."
2. Using Chr Function:
Another way to escape a double quote is by using the Chr function. This function takes the ASCII code of a character and returns the character itself. The ASCII code for a double quote is 34. So, you can use the following:
message = "This is a message with a quote " & Chr(34) & "inside" & Chr(34) & " it."
3. Concatenation:
If the variable you want to use already contains double quotes, you can simply concatenate it with another string using the + operator. For example:
var1 = "This is the first part" var2 = " with a quote" finalString = var1 + var2 + "."
Choosing the Right Method:
The best method depends on your specific situation. If you’re building a string with a single embedded quote, escaping with a double quote is the simplest way. If you’re working with pre-defined variables that might contain quotes, concatenation or the Chr function might be more suitable.