Hello,
Is it possible to save data to 2 columns with 1 line?
What is the column separator?
I want to save data returned by JavaScript array.
Thanks.
Hello,
Is it possible to save data to 2 columns with 1 line?
What is the column separator?
I want to save data returned by JavaScript array.
Thanks.
You must use this command !csvLine to save multiple column in one line.
The line is the loop, in a single line you can save unilimite columns
{
“Command”: “store”,
“Target”: “one”,
“Value”: “!csvline”,
“Description”: “”
},
{
“Command”: “store”,
“Target”: “two”,
“Value”: “!csvline”,
“Description”: “”
},
{
“Command”: “csvSave”,
“Target”: “test”,
“Value”: “”,
“Description”: “”
}
There are 2 commands for 2 columns.
is it possible to save to 2 columns with 1 command?
I think it’s not possible, waiting other users for seggestions
I tried with comma as separator but not working
Yu could use a executeScript_Sandbox
to return an array to a UI.Vision variable and then save it as a CSV
executeScript_Sandbox | ar = [["a","b"]]; return ar; | ar
csvSaveArray | ar | C:\kantu\csv\ar.csv
one dimensional array is fine?
i tried so much
working now
awesome
Thanks.
how to use with single dimension array?
I have single dimension array returned by javascript
how to use the command csvSaveArray ?
You need it to be 2D array, you can simply convert it to 2D wrapping your 1D array inside []
i.e.
var oneD = ["a","b"]; var twoD = [oneD];
It is working.
nice solution.
How to save in multiple rows with above solution?
csvSaveArray overwrites existing data.
I tried following code but it saves in 1 row.
I want to save in multiple rows with one command.
Because command overwrites existing data.
var oneD = [];
oneD.push(“a”,“1”);
oneD.push(“b”,“2”);
var twoD = [oneD];
return twoD;
You would need to do an csvReadArray first. Then add your lines to the array, then do csvSaveArray.
Can you share example code?
{
“Name”: “1”,
“CreationDate”: “2022-2-9”,
“Commands”: [
{
“Command”: “csvReadArray”,
“Target”: “names - Copy.csv”,
“Value”: “Test”,
“Description”: “”
},
{
“Command”: “executeScript_Sandbox”,
“Target”: “var ar=${Test};\nar.push(‘abc’);\n\nvar ar2 = [ar];\nreturn ar2;”,
“Value”: “Test”,
“Description”: “”
},
{
“Command”: “prompt”,
“Target”: “${Test}”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “csvSaveArray”,
“Target”: “Test”,
“Value”: “names - Copy”,
“Description”: “”
}
]
}
names - Copy.csv
It has few rows of data
Output file is saved in 1st cell of CSV
Data is not appened at end
I want to append multiple columns with one command