Open JRPoinsot opened 4 years ago
Silly question but what happens if you use double quotes:?
clasp run setProperties --params "[{'foo':'bar'}]"
I had clasp run setProperty -p ["domain" "mydomain.com"]
working a few days ago. It was great.
Now, I cannot find the proper JSON format. I read here to use "...space-separated array of values such...". So I don't know what could have gone wrong?
Here is what I tried:
PC:AppsScript-CLASP user$ clasp run setProperty -p ["domain" "mydomain.com"]
Input params not Valid JSON string. Please fix and try again
PC:AppsScript-CLASP user$ clasp run setProperty -p ["domain","mydomain.com"]
Input params not Valid JSON string. Please fix and try again
PC:AppsScript-CLASP user$ clasp run setProperty -p ['domain','mydomain.com']
Input params not Valid JSON string. Please fix and try again
PC:AppsScript-CLASP user$ clasp run setProperty -p ['domain' 'mydomain.com']
Input params not Valid JSON string. Please fix and try again
PC:AppsScript-CLASP user$ clasp run setProperty -p [{'domain': 'mydomain.com'}]
Input params not Valid JSON string. Please fix and try again
PC:AppsScript-CLASP user$ clasp run setProperty -p "['domain' 'mydomain.com']"
Input params not Valid JSON string. Please fix and try again
PC:AppsScript-CLASP user$ clasp run setProperty -p '['domain' 'mydomain.com']'
Input params not Valid JSON string. Please fix and try again
Node v8.11.1 Clasp v2.3.0 MacOs BigSur v11.2.1
The JSON format that works for me: '["domain","mydomain.com"]'
Additionally, I needed to run node LTS, and I was behind.
Just to be sure the issue still exist, can you try replacing @google/clasp
2.3.0 with forked-clasp
which is more advanced?
npm uninstall -g @google/clasp
npm install -g forked-clasp
I noticed that there's not a single test case in https://github.com/google/clasp/blob/master/test/commands/run.ts
for --params
I had the same problem.
I use windows cmd, so the parameter was "splited" because of the double quotes
Cmd does not use single quotes, so I used \"
instead and it worked
The correct code was something like this:
clasp run "myFunction" -p "[\"test\"]"
I use windows cmd, so the parameter was "splited" because of the double quotes Cmd does not use single quotes, so I used
\"
instead and it workedThe correct code was something like this:
clasp run "myFunction" -p "[\"test\"]"
@Claudiney-Santos I know this was an old reply, but thanks for pointing this out. This solved my problem. I hope this is included in the formal documentation.
Expected Behavior
My function : function setProperties(properties) { PropertiesService.getScriptProperties.setProperties(properties, false); }
Actual Behavior
response : Input params not Valid JSON string. Please fix and try again. A try other basic JSON format ... but same message.
Specifications
node -v
): v10.16.3clasp -v
): 2.3.0