# How to send variable and image to google script editor

**URL:** <https://community.thunkable.com/t/how-to-send-variable-and-image-to-google-script-editor/2254636>\
**Category:** Questions about Thunkable X\
**Tags:** beginner\
**Created:** [February 2, 2023, 11:42am UTC](https://community.thunkable.com/t/how-to-send-variable-and-image-to-google-script-editor/2254636 "2023-02-02T11:42:22Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![pvi](https://avatars.discourse-cdn.com/v4/letter/p/7c8e57/32.png) [@pvi](https://community.thunkable.com/u/pvi)\
**Post date:** [February 2, 2023, 11:42am UTC](https://community.thunkable.com/t/how-to-send-variable-and-image-to-google-script-editor/2254636/1 "2023-02-02T11:42:22Z")

</div>

Hello everyone !

I look on many topics but i can’t find explicit solution.

So i’m asking for :

1. I have created a script, but I would like to know exactly which URL to enter in the advanced parameters of web\_api to create my link with.

2. I would like to send to my script initialized variables from my project on thunkable in order to be able to process them directly from my script.

3. is it possible to send images directly from thunkable to be able to store them on my google drive

cf view :

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/7/8768fd93d35b604ce2c48579ccf29e9d83c300a7.png)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/7/97fbffa84d9543a665111e6121dda7f10feed7bb.png)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/1/6139c38decc4a442f75cbc392e5422dd12c50af1.png)

---

<div class="post-metadata">

**Author:** ![pvi](https://avatars.discourse-cdn.com/v4/letter/p/7c8e57/32.png) [@pvi](https://community.thunkable.com/u/pvi)\
**Post date:** [February 2, 2023, 4:19pm UTC](https://community.thunkable.com/t/how-to-send-variable-and-image-to-google-script-editor/2254636/2 "2023-02-02T16:19:24Z")

</div>

Re !

i try to do this to see fault or anything.

And i have that : response : \>htmlclass=“google mmfb” lang=“en”\>\<scriptnonce="XE9… etc etc  
statut : 200  
error : undefined

please help me 🙁

i don’t understand because my register under block do correctly the task

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/d/cdb533821ece130899cc216abb73d18a40b8ab21.png)

---

<div class="post-metadata">

**Author:** ![shrey](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/shrey/32/105637_2.png) [@shrey](https://community.thunkable.com/u/shrey)\
**Post date:** [February 2, 2023, 11:30pm UTC](https://community.thunkable.com/t/how-to-send-variable-and-image-to-google-script-editor/2254636/3 "2023-02-02T23:30:52Z")

</div>

Hey there, the thing is your apps script project has 3 problems.

The first problem is that you forgot to add parameters between event and nom/prenom.

The second problem is to rename _event_ to _e_.

Fixed code:

```auto
function doPost(e) {

  var nomClient = e.parameters.nom;
  var prenomClient = e.parameters.prenom;

  DriveApp.createFolder("Mr " + nomClient + " " + prenomClient);
};

```

The third problem is that in Thunkable you put the wrong URL in the API URL. In order to put the correct URL, you need to publish you Apps Script problem as a web app.

Steps:  
To deploy a script as a web app, follow these steps:

1. At the top right of the script project, click **Deploy** \> **New deployment**.
2. Next to “Select type,” click Enable deployment types settings \> **Web app**.
3. Set “Execute as” to **Me** and then set “Who has access” to **Anyone**
4. Click **Deploy**.

Then just paste the URL you get into the Web API’s URL block you have.

I think that’s all!

---

<div class="post-metadata">

**Author:** ![pvi](https://avatars.discourse-cdn.com/v4/letter/p/7c8e57/32.png) [@pvi](https://community.thunkable.com/u/pvi)\
**Post date:** [February 3, 2023, 9:19am UTC](https://community.thunkable.com/t/how-to-send-variable-and-image-to-google-script-editor/2254636/4 "2023-02-03T09:19:36Z")

</div>

Hi Shrey !

Thanks for your solutions, i think my URL is good now.

But for my queryparameters in thunkable view, it’s not copy to my script on google, i don’t understand why… An idea ?

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/6/66c8a54a8e56777049a23367f9813c8a4d2b2c53.png)

This next view is my fonction to post on my Google drive.  
The purpose of this function is to retrieve all kinds of information stored in my sthunkable variables to my script in order to be reprocessed later.  
There is also a sending of these variables to a google sheets in order to have a register of requests sent via the thunkable application. Which, by the way, works very well! 🙂

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/7/67b247592e1c2c5798d4ad07c9613f785d47d5b0.png)

Probably my problem is on that part with a wrong url ? I don’t know how to put a right url with a key finding on google drive api. Do you have a method to explain to me ?

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/d/3d8af97d4ed7e8956d1a4464c22a8d0c950447f8.png)

---

<div class="post-metadata">

**Author:** ![shrey](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/shrey/32/105637_2.png) [@shrey](https://community.thunkable.com/u/shrey)\
**Post date:** [February 3, 2023, 2:28pm UTC](https://community.thunkable.com/t/how-to-send-variable-and-image-to-google-script-editor/2254636/5 "2023-02-03T14:28:13Z")

</div>

~~You dont need to put the google drive api in thunkable. You can just enable the google drive api on the left side of apps script where it says services.~~

**EDIT:** Sorry, I misunderstood you.

---

<div class="post-metadata">

**Author:** ![pvi](https://avatars.discourse-cdn.com/v4/letter/p/7c8e57/32.png) [@pvi](https://community.thunkable.com/u/pvi)\
**Post date:** [February 3, 2023, 3:30pm UTC](https://community.thunkable.com/t/how-to-send-variable-and-image-to-google-script-editor/2254636/6 "2023-02-03T15:30:25Z")

</div>

What I don’t understand is that with my current thunkable code and my script, as soon as I simulate with my mobile phone, I should have my script that is triggered and create a folder for me with the first and last name with my variable from thunkable?

But none of this, so I guess my variables don’t make it to the script.

---

<div class="post-metadata">

**Author:** ![shrey](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/shrey/32/105637_2.png) [@shrey](https://community.thunkable.com/u/shrey)\
**Post date:** [February 3, 2023, 11:21pm UTC](https://community.thunkable.com/t/how-to-send-variable-and-image-to-google-script-editor/2254636/7 "2023-02-03T23:21:40Z")

</div>

Does the folder get created? If yes, is the folder’s name blank or does it just show “Mr”?

---

<div class="post-metadata">

**Author:** ![pvi](https://avatars.discourse-cdn.com/v4/letter/p/7c8e57/32.png) [@pvi](https://community.thunkable.com/u/pvi)\
**Post date:** [February 6, 2023, 7:07am UTC](https://community.thunkable.com/t/how-to-send-variable-and-image-to-google-script-editor/2254636/8 "2023-02-06T07:07:49Z")

</div>

Hi,

the folder isn’t created 🙁

I get that when i use debug mode :

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/8/d8d9f97074335e1fe5145ea280214ff2e6e661a1.png)

---

<div class="post-metadata">

**Author:** ![shrey](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/shrey/32/105637_2.png) [@shrey](https://community.thunkable.com/u/shrey)\
**Post date:** [February 6, 2023, 12:35pm UTC](https://community.thunkable.com/t/how-to-send-variable-and-image-to-google-script-editor/2254636/9 "2023-02-06T12:35:57Z")

</div>

Try running the script from your Thunkable app instead.

---

<div class="post-metadata">

**Author:** ![pvi](https://avatars.discourse-cdn.com/v4/letter/p/7c8e57/32.png) [@pvi](https://community.thunkable.com/u/pvi)\
**Post date:** [February 8, 2023, 9:56am UTC](https://community.thunkable.com/t/how-to-send-variable-and-image-to-google-script-editor/2254636/10 "2023-02-08T09:56:14Z")

</div>

Hello !

i do that :

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/7/07453ac38c2019500f0e8a817d786a3756b93e3d.png)

and when i submit by thunkable on mobile, it works halfway. This creates a folder for me at the root of my google drive with the first and last name that I entered in thunkable, however afterwards it blocks on the sheet creation line. I feel like it was like the value of the variables jumped to the previous line…

---

<div class="post-metadata">

**Author:** ![pvi](https://avatars.discourse-cdn.com/v4/letter/p/7c8e57/32.png) [@pvi](https://community.thunkable.com/u/pvi)\
**Post date:** [February 8, 2023, 10:39am UTC](https://community.thunkable.com/t/how-to-send-variable-and-image-to-google-script-editor/2254636/11 "2023-02-08T10:39:28Z")

</div>

For example i do that :

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/9/0983be808a21cc266c22a767fec447133ddab87f.png)

You can see the script with constant variable do perfectly the task. My problem, i think, is between thunkable and my script. My script can’t get receive variable or thunkable does anything…

---

<div class="post-metadata">

**Author:** ![pvi](https://avatars.discourse-cdn.com/v4/letter/p/7c8e57/32.png) [@pvi](https://community.thunkable.com/u/pvi)\
**Post date:** [February 8, 2023, 1:41pm UTC](https://community.thunkable.com/t/how-to-send-variable-and-image-to-google-script-editor/2254636/12 "2023-02-08T13:41:15Z")

</div>

I try this method, it doesn’t running work either…

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/f/ef925c66ce00b1dde0c7aa16957e5539ec518faa.png)

An idea ?

---

<div class="post-metadata">

**Author:** ![pvi](https://avatars.discourse-cdn.com/v4/letter/p/7c8e57/32.png) [@pvi](https://community.thunkable.com/u/pvi)\
**Post date:** [February 15, 2023, 9:01am UTC](https://community.thunkable.com/t/how-to-send-variable-and-image-to-google-script-editor/2254636/13 "2023-02-15T09:01:43Z")

</div>

Hello World !

There is someone to help me hier please ?

@shrey ??

---

<div class="post-metadata">

**Author:** ![shrey](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/shrey/32/105637_2.png) [@shrey](https://community.thunkable.com/u/shrey)\
**Post date:** [February 20, 2023, 5:43pm UTC](https://community.thunkable.com/t/how-to-send-variable-and-image-to-google-script-editor/2254636/14 "2023-02-20T17:43:47Z")

</div>

I’m sorry, but I don’t have access to a computer right now, so I won’t be able to help you right now.

---

<div class="post-metadata">

**Author:** ![pvi](https://avatars.discourse-cdn.com/v4/letter/p/7c8e57/32.png) [@pvi](https://community.thunkable.com/u/pvi)\
**Post date:** [February 28, 2023, 7:09am UTC](https://community.thunkable.com/t/how-to-send-variable-and-image-to-google-script-editor/2254636/15 "2023-02-28T07:09:02Z")

</div>

Hello World !

I need help please, realy… I don’t find my probably errors…

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [February 28, 2023, 8:14am UTC](https://community.thunkable.com/t/how-to-send-variable-and-image-to-google-script-editor/2254636/16 "2023-02-28T08:14:00Z")

</div>

In Google Scripts there are **parameters** and also **parameter**. You need to check which one works for you.

When the **debug** says `parameters is undefined` it means it has not been created by the **event** object.

---

<div class="post-metadata">

**Author:** ![pvi](https://avatars.discourse-cdn.com/v4/letter/p/7c8e57/32.png) [@pvi](https://community.thunkable.com/u/pvi)\
**Post date:** [March 1, 2023, 8:10am UTC](https://community.thunkable.com/t/how-to-send-variable-and-image-to-google-script-editor/2254636/17 "2023-03-01T08:10:18Z")

</div>

Hi, thanks @muneer for your answer.

I try with “parameter” and “parameters”, but when i submit by thunkable mobile application, it doesn’t run on my googgle script.

You can look on previous view that i create on thunkable a second method to send the same variables on a google sheet. And this method run perfectly.

So, from my point of view, i think errors are in my part of code of my button submit on thunkable.

here are the latest updated pictures :

google script

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/2/2278c529f9373bb7fced50062e3ddf9324f5764e.png)

funtion submit in thunkable

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/9/49cbccda31a87b72cf56bbbf4656b4de723ca65d.png)

Thanks for your help !

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [March 1, 2023, 11:59am UTC](https://community.thunkable.com/t/how-to-send-variable-and-image-to-google-script-editor/2254636/18 "2023-03-01T11:59:39Z")

</div>

The blocks you shared don’t contain any parameters and therefore nothing will be passed to the Google Apps Script.

you are using `web_API Body` to pass parameters which is not what the GAS is trying to retrieve.

To use the **e.parameter** or **e.parameters** you have to use `web_API QueryParameters`  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/d/fdbf3da1bdf3379877edd55dc846849f8fadf74a.png)

---

<div class="post-metadata">

**Author:** ![pvi](https://avatars.discourse-cdn.com/v4/letter/p/7c8e57/32.png) [@pvi](https://community.thunkable.com/u/pvi)\
**Post date:** [March 1, 2023, 1:41pm UTC](https://community.thunkable.com/t/how-to-send-variable-and-image-to-google-script-editor/2254636/19 "2023-03-01T13:41:03Z")

</div>

So, I changed as you recommanded my thunkable like this :

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/1/e12d8fe013c323ac6151e3ec2a59a53601a82e61.png)

But it doesn’t run yet. Do you have an idea ?

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [March 1, 2023, 4:26pm UTC](https://community.thunkable.com/t/how-to-send-variable-and-image-to-google-script-editor/2254636/20 "2023-03-01T16:26:28Z")

</div>

I assume you already tested that the Google Apps Script is deployed as **web app**.

Also, run the blocks from your mobile because API calls from the computer is nor consistent.

See a sample project I made  
[https://x.thunkable.com/projectPage/618cfa678cdb0f0011998dbe](https://x.thunkable.com/projectPage/618cfa678cdb0f0011998dbe)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/c/5c4ded2ceaa28c2d65e6d44e2037180a6ae79e63.png)  
This is the corresponding GAS.

[Next page](https://community.thunkable.com/t/how-to-send-variable-and-image-to-google-script-editor/2254636.md?page=2)
