Convert Base64 string to images
Requirement
Store Base64 strings and their automatically converted corresponding images.
Use Case
A marketing team uses base64 strings to render images on their webpage instead of direct image files to reduce the webpage
load time. So they store base64 strings in an app for their reference which are converted to images and stored in an image field in the report.
Steps to follow
| Field Name | Field Link Name |
Multi Line | Base64 text | Base64_text |
Image | Image | Image |
Now let's create a
connection that will be used later in this tutorial
3. Select Zoho OAuth.
4. Select the required scopes for Creator, fill in other details, and click Create and Authorize.

Ensure that the connection is
enabled for this app
6. Now let's write a script to
convert the base64 string into an image and upload it to
Image field. Click
Add New Action >
Deluge Script and save the following script in the Deluge editor:
- // store the record ID in a variable
- recID = input.ID;
- // convert base64 string into image
- imageValue = zoho.encryption.base64DecodeToFile(input.Base64_text,"sample_file.png");
- // use creator api to upload the converted image to image field
- imageValue.setParamName("file");
- invokeSyntax = invokeurl
- [
- url :"https://creator.zoho.com/api/v2/<app_owner_name>/<app_name>/report/<report_link_name>/" + recID + "/Image/upload"
- type :POST
- files:imageValue
- connection:"creator"
- ];
7. You can also hide the Image field when the form loads since it is not filled by users manually. Create a workflow with the following details:
8. Click Add New Action and save the following script:
See how it works
Sample data
You can download the attached files at the end of this page that each contain an encoded base64 string for a sample image and upload it in your image field. The relevant image will be rendered in your report.

Tip: You can use
this website to simply drag and drop, upload, or provide an image URL in the space provided and the encoder will quickly generate a Base64 encoded version of that image.