google-drive-cms icon indicating copy to clipboard operation
google-drive-cms copied to clipboard

'Invalid Argument' when exporting

Open m4rrc0 opened this issue 7 years ago • 3 comments

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'.

m4rrc0 avatar May 18 '17 07:05 m4rrc0

Error in running "Google Drive CMS" / "Export content" option.

Steps to duplicate:

  1. Open https://www.drivecms.xyz/documentation.html
  2. 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 in View only mode
  1. Select menu option "File" / "Make a copy..."
  2. Change the name of the copy Test Export Google Drive CMS, click OK
  3. In cell A1 enter test_key
  4. In cell A3 enter test value
  5. Select menu option "Google Drive CMS" / "Export content"
  6. 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:

  1. Select menu option "Tools" / "Script Editor"
  2. Click on Export.gs
  3. In the Export.gs script, go to line 42 which says:
  • var createdFile = exportsFolder.createFile(fname, json, MimeType.JSON);
  1. Change MimeType.JSON to MimeType.PLAIN_TEXT
  2. Select menu option "File" / "Save"
  3. Close Drive CMS tab
  4. Back in the Test Export Google Drive CMS tab select menu option "Google Drive CMS" / "Export content"
  5. Receive the message: A JSON file has been created in the same directory as this spreadsheet.

bseaver avatar Jun 15 '17 22:06 bseaver

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.

bseaver avatar Jun 15 '17 23:06 bseaver

I ran into this today and implemented the same the workaround.

metafeather avatar Jul 07 '17 13:07 metafeather