=“INSERT INTO MICASA.MICASA VALUES ('”&A2&“‘,‘001’,’”&C2&“‘,’”&SI(ESBLANCO(E2);“####”;E2)&“‘,’”&SI(ESBLANCO(G2);“####”;G2)&“');”
I’m trying to add a new job in UIpath with Write cell excel but when i try to copy the full query is giving me some compilation error. As I undertand, seems like there are a lot of " and Uipath don’t know how to manage in terms of dicrimine if is formula , string or whatever. Please , could you help me in order to compose this formula?
First make sure to use the correct Excel Activites. For example: App Integration > Excel > Write Cell
The Workbook Activities don’t need EXCEL installed but can’t handle formulas and give an error if the file contains formulas.
For the string you can replace every " with “+Chr(34)+” to write your formula.
In your posted example:
“=”+Chr(34)+“INSERT INTO MICASA.MICASA VALUES (’”+Chr(34)+“&A2&”+Chr(34)+“’,‘001’,’”+Chr(34)+“&C2&”+Chr(34)+“’,’”+Chr(34)+“&SI(ESBLANCO(E2);”+Chr(34)+“####”+Chr(34)+“;E2)&”+Chr(34)+“’,’”+Chr(34)+“&SI(ESBLANCO(G2);”+Chr(34)+“####”+Chr(34)+“;G2)&”+Chr(34)+“’);”+Chr(34)
Be careful on the very end. Since you have to write a quotation at the end you need to encapsulate your string in “…” + Chr(34) in order to add the last " in the Excel File.