# Google Forms File Uploads

**URL:** <https://forum.kintone.dev/t/google-forms-file-uploads/210>\
**Category:** General\
**Tags:** google-forms-integration\
**Created:** [October 28, 2021, 1:36am UTC](https://forum.kintone.dev/t/google-forms-file-uploads/210 "2021-10-28T01:36:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [October 28, 2021, 1:36am UTC](https://forum.kintone.dev/t/google-forms-file-uploads/210/1 "2021-10-28T01:36:10Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [October 28, 2021, 6:02pm UTC](https://forum.kintone.dev/t/google-forms-file-uploads/210/2 "2021-10-28T18:02:17Z")

</div>

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.

[Post Google Forms Responses into Kintone - Kintone Developer Program](https://kintone.dev/en/tutorials/3rd-party-services/post-google-forms-responses-into-kintone/)

```javascript
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.

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [October 29, 2021, 9:11pm UTC](https://forum.kintone.dev/t/google-forms-file-uploads/210/3 "2021-10-29T21:11:47Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [October 31, 2021, 11:42pm UTC](https://forum.kintone.dev/t/google-forms-file-uploads/210/4 "2021-10-31T23:42:51Z")

</div>

Hello James,

In Kintone, you can upload files using the [Upload File API](https://kintone.dev/en/docs/kintone/rest-api/files/upload-file/).  
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.

I hope this helps.
