Error when uploading to Google Drive

I have a scenario that is receiving data via a webhook from FormAssembly

I am attempting to upload the resulting file via the GOOGLE DRIVE UPLOAD module.

Getting this error on my upload module:
image

I can solve the filename error - but not sure how to deal with the 'Value can’t be casted as buffer for parameter ‘data’ error.

Here’s my config for the upload module:

Was thinking I’d need to add an Iterator to address multiple files – but not sure that will actually solve this problem.

I’ve attached the webhook output json here
attachmentoutput.json (1.5 KB)

Solved it!

Added an iterator and used the map function to have it look for the file:
image

Overall - works great (in case someone else comes across this post!). Form comes in - creates a new timestamp folder in the clients directory, uploads the files and creates a description txt file with info from the form.

Well…I spoke too soon. Seems to work with multiple files, but getting an error with a single file:

image

image

Help!

The file.files[].data in your first screenshot are individual sheets within a Google Sheet document.

You should ignore that and just upload/map the entire document file using file.data, which should also work for single file. In actual fact there is only one file /one file data per bundle, so there is no need for an iterator.

2 Likes

Thanks for the reply. I thought that’s what I was doing?

image

Yes, but I also said there is no need for an iterator.

Map this in your Google Drive’s data field.

{{1.file.data}}

2 Likes

Thanks - tried that:
image

Now getting this error on the google upload:

image

I’ll need the output bundle of your webhook module.

Please provide the output bundles of the modules by running the scenario, then click the white speech bubble on the top-right of each module, save the bundle contents in your text editor as a bundle.json file, and upload it here into this discussion thread.
Screenshot_2023-10-06_141025

Providing the output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

This will allow others to better assist you. Thanks!

2 Likes

Attached are the output jsons - thank you!
singlefieldupload.json (8.3 KB)
webhook.json (1.4 KB)

Oh no, looks like your text editor added formatting to the text, and it’s no longer valid JSON.

Could you use a plain text editor like Notepad, that doesn’t have rich text formatting features?

2 Likes

Hi @Brian-HFLA

I see that mappings are wrong. In your data, file name can be seen as “File” or “files” but not “file”. Please map the data correctly or try this {{1.File.data}}
Also you are mapping same variable at both fields, name and data. name should contain mapping like {{1.File.name}}

If you require additional assistance, please don’t hesitate to reach out to us.
MSquare Support
Visit us here
Youtube Channel

2 Likes

Thank you! I will make those adjustments and report back!

2 Likes