# Storing Picture of canvas in airtable for dataviewercomponent

**URL:** https://community.thunkable.com/t/storing-picture-of-canvas-in-airtable-for-dataviewercomponent/1042352
**Category:** Questions about Thunkable X
**Created:** [January 8, 2021, 6:41am UTC](https://community.thunkable.com/t/storing-picture-of-canvas-in-airtable-for-dataviewercomponent/1042352 "2021-01-08T06:41:10Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![chilledtimes.edition](https://avatars.discourse-cdn.com/v4/letter/c/edb3f5/32.png) [@chilledtimes.edition](https://community.thunkable.com/u/chilledtimes.edition)
#### Post date: [January 8, 2021, 6:41am UTC](https://community.thunkable.com/t/storing-picture-of-canvas-in-airtable-for-dataviewercomponent/1042352/1 "2021-01-08T06:41:10Z")

</div>

**Hi,**  
**for my app, once a user draws something on a canvas, the canvas image should get stored to airtable.**  
since the image returned is in base64 format, airtable throws back an error( i tried with various field types but none worked)  
also Cloudinary too doesnt accept this format pictures

so next my plan was to convert this base64format to url, but i wasnt able to find such APIs

**so, is there any other way to store this picture in airtable ?**

---

<div class="post-metadata">

### Author: ![v.krishna](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/v.krishna/32/84811_2.png) [@v.krishna](https://community.thunkable.com/u/v.krishna)
#### Post date: [January 8, 2021, 8:02am UTC](https://community.thunkable.com/t/storing-picture-of-canvas-in-airtable-for-dataviewercomponent/1042352/2 "2021-01-08T08:02:46Z")

</div>

You can use [`btoa()`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/btoa) and [`atob()`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/atob) to convert to and from base64 encoding.

There appears to be some confusion in the comments regarding what these functions accept/return, so…

- `btoa()` accepts a “string” where each character represents an 8-bit byte – if you pass a string containing characters that can’t be represented in 8 bits, [it will probably break](https://developer.mozilla.org/en-US/docs/Web/API/window.btoa#Unicode_Strings). This isn’t a problem _if_ you’re actually treating the string as a byte array, but if you’re trying to do something else then you’ll have to encode it first.
- `atob()` returns a “string” where each character represents an 8-bit byte – that is, its value will be between `0` and `0xff`. This does _not_ mean it’s ASCII – presumably if you’re using this function at all, you expect to be working with binary data and not text.

Sorry, but I copied from stack overflow. you can post this image to through post message in thunkable and learn about this btoa() method and decode it

---

<div class="post-metadata">

### Author: ![chilledtimes.edition](https://avatars.discourse-cdn.com/v4/letter/c/edb3f5/32.png) [@chilledtimes.edition](https://community.thunkable.com/u/chilledtimes.edition)
#### Post date: [January 8, 2021, 8:24am UTC](https://community.thunkable.com/t/storing-picture-of-canvas-in-airtable-for-dataviewercomponent/1042352/3 "2021-01-08T08:24:34Z")

</div>

ok i get it but should i do it with an external scripter like google script ?  
thanks for the method though

---

<div class="post-metadata">

### Author: ![v.krishna](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/v.krishna/32/84811_2.png) [@v.krishna](https://community.thunkable.com/u/v.krishna)
#### Post date: [January 8, 2021, 8:25am UTC](https://community.thunkable.com/t/storing-picture-of-canvas-in-airtable-for-dataviewercomponent/1042352/4 "2021-01-08T08:25:45Z")

</div>

vs code studio is best editor and you must learn a bit of js ofcourse

---

<div class="post-metadata">

### Author: ![chilledtimes.edition](https://avatars.discourse-cdn.com/v4/letter/c/edb3f5/32.png) [@chilledtimes.edition](https://community.thunkable.com/u/chilledtimes.edition)
#### Post date: [January 8, 2021, 8:26am UTC](https://community.thunkable.com/t/storing-picture-of-canvas-in-airtable-for-dataviewercomponent/1042352/5 "2021-01-08T08:26:49Z")

</div>

but how to use it along with my thunkable app ? VS Code does not havea web api right ?

---

<div class="post-metadata">

### Author: ![v.krishna](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/v.krishna/32/84811_2.png) [@v.krishna](https://community.thunkable.com/u/v.krishna)
#### Post date: [January 8, 2021, 8:27am UTC](https://community.thunkable.com/t/storing-picture-of-canvas-in-airtable-for-dataviewercomponent/1042352/6 "2021-01-08T08:27:18Z")

</div>

publish it using github

---

<div class="post-metadata">

### Author: ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)
#### Post date: [November 8, 2024, 1:30pm UTC](https://community.thunkable.com/t/storing-picture-of-canvas-in-airtable-for-dataviewercomponent/1042352/7 "2024-11-08T13:30:57Z")

</div>


