Google Forms File Uploads

I have a Google Form connected to a db. So far so good. I am able to create new records when the user fills out the form and submits.

Is it possible for people to upload files via the Google Form that would automatically save to the new record as well?

Hello James,

 

I’m not sure if you have already seen this article, but I have found a sample code using the code from step 3 of “3. Create a Google Apps Script Program.”

Please take a look and see if it helps achieve the desired process.

 

Linking Google Forms and Kintone:

https://developer.kintone.io/hc/en-us/articles/115002489614-Linking-Google-Forms-and-Kintone

 

var records = '[';

records += Utilities.formatString('{"Email": { "value": "%s" }', e.response.getRespondentEmail());//Get Respondent Email

for (var i = 0; i < itemResponses.length; i++) {

var itemResponse = itemResponses[i];

switch (itemResponse.getItem().getTitle()) {

case 'Would you like to participate in this event?':

records += Utilities.formatString(',"attend" : { "value": "%s" }',

itemResponse.getResponse());//Get Response

break;

case 'The number of participants':

records += Utilities.formatString(',"number_of_attendee" : { "value": "%s" }',

itemResponse.getResponse());//Get Response

break;

case 'Please enter the names of the participants':

records += Utilities.formatString(',"name_of_attendee" : { "value": "%s" }',

itemResponse.getResponse());//Get Response

break;

}

}

records += '}]';

 

It’s like creating a file attachment field in Google Forms, creating an attachment field on the kintone app side, and linking the data.

 

Hopefully, this helps.

Yes! This is what I used to get as far as I did.

The article above doesn’t specify whether or not it’s actually possible to get the uploaded file into a Kintone database. I got the text/checkboxes/radio buttons just fine, but a file is kind of a different animal.

I followed the above examples as well as I could, but the file still gets uploaded to my Google Drive. I’ll continue trying. It’s possible I’m just missing something.

Thank you for the reply!

Hello James,

In Kintone, you can upload files using the Upload File API.
The basic flow of attaching files to Kintone records is you first need to execute the File Upload API.
And then, using the Add Record and the Update Record API, you need to link the file to an attachment field in a record.

FYI, after executing the File Upload API (when a file is uploaded to Kintone), it produces a fileKey.
You will need to use this filekey in the Add Record or Update Record API to upload the file to an Attachment field.
Just executing the Upload File API does not upload the file to an Attachment field of an App.

Kintone Developer Program - Upload File
https://developer.kintone.io/hc/en-us/articles/212494448-Upload-File

I hope this helps.