google-drive-cms
google-drive-cms copied to clipboard
'Invalid Argument' when exporting
Apparently exporting does not work out of the box. I created a dummy value to test the export feature and I get a not-to-meaningful error 'Invalid Argument'.
Error in running "Google Drive CMS" / "Export content" option.
Steps to duplicate:
- Open https://www.drivecms.xyz/documentation.html
- Under Installation, option 2: Make a copy of the core template yourself using (this link)[https://docs.google.com/spreadsheets/d/15ifxjEo9nVXTbeX7mwLnW-F5yu96u9IF1RL3wHoYLbs/edit?usp=sharing]
- Click on the link - which opens
Google Drive CMS Master
sheet inView only
mode
- Select menu option "File" / "Make a copy..."
- Change the name of the copy
Test Export Google Drive CMS
, click OK - In cell A1 enter
test_key
- In cell A3 enter
test value
- Select menu option "Google Drive CMS" / "Export content"
- Follow any prompts to authorize and allow Drive CMS to work with your Google Drive files.
At this point as of June 15, 2017 9:00 am (Americas - Los Angeles time) I see the error message:
-
Invalid argument _Details_ _Dismiss_
The following is an unvetted workaround to the error by following these steps:
- Select menu option "Tools" / "Script Editor"
- Click on Export.gs
- In the Export.gs script, go to line 42 which says:
- var createdFile = exportsFolder.createFile(fname, json, MimeType.JSON);
- Change
MimeType.JSON
toMimeType.PLAIN_TEXT
- Select menu option "File" / "Save"
- Close
Drive CMS
tab - Back in the
Test Export Google Drive CMS
tab select menu option "Google Drive CMS" / "Export content" - Receive the message:
A JSON file has been created in the same directory as this spreadsheet.
Another workaround for the time being could be to omit the third parameter of the createFile function. So line 42 could simply be:
- var createdFile = exportsFolder.createFile(fname, json);
This might be a safer choice if "MimeType.PLAIN_TEXT" is incorrect.
In any case, after making the workaround, see if you can fully utilize your exported file. Also try adding some UTF-8 multi byte characters and verifying these are properly exported and used by your down stream system.
I ran into this today and implemented the same the workaround.