Skip to product menu
close
  • Recent Launches
    Press Space or Enter to display list of options
EXPLORE ALL PRODUCTS

Recent Launches

New

Payroll software with automated tax payments and filing.

Try now
New

Robotic process automation software to automate high-volume, rule-based tasks.

Try for free
New

Low-code IoT platform and solutions for connected businesses.

Try now
New

Business formation service to launch and grow your businesses.

Try now
New

Privacy-friendly application analytics solution.

Try for free

Sales

 
CRM

Comprehensive CRM platform for customer-facing teams.

CRM
 
Bigin

Simple CRM for small businesses moving from spreadsheets.

Bigin
 
Forms

Build online forms for every business need.

Forms
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
Sign

Digital signature app for businesses.

Sign
 
RouteIQ

Comprehensive sales map visualization and optimal route planning solution.

RouteIQ
 
Thrive

Complete loyalty and affiliate management platform.

Thrive
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
Suites
CRM Plus

Unified platform to deliver top-notch customer experience.

CRM Plus

Marketing

 
Social

All-in-one social media management software.

Social
 
Campaigns

Create, send, and track targeted email campaigns that drive sales.

Campaigns
 
Forms

Build online forms for every business need.

Forms
 
Survey

Design surveys to reach and interact with your audience.

Survey
 
Sites

Online website builder with extensive customisation options.

Sites
 
PageSense

Website conversion optimization and personalisation platform.

PageSense
 
Backstage

End-to-end event management software.

Backstage
 
Webinar

Webinar platform for webcasting online webinars.

Webinar
 
Marketing Automation

All-in-one marketing automation software.

Marketing Automation
 
LandingPage

Smart landing page builder to increase conversion rates

LandingPage
 
Publish

Manage all your local business listings on a single platform.

Publish
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Sign

Digital signature app for businesses.

Sign
 
Thrive

Complete loyalty and affiliate management platform.

Thrive
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
NEW
LeadChain

Sync, manage, and convert leads across channels seamlessly.

LeadChain
 
NEW
CommunitySpaces

Online community platform for individuals and businesses to grow their network and brand.

CommunitySpaces
 
Suites
Marketing Plus

Unified marketing platform for marketing teams.

Marketing Plus

Commerce and POS

 
Commerce

eCommerce platform to manage and market your online store.

Commerce

Service

 
Desk

Helpdesk software to deliver great customer support.

Desk
 
Assist

Remote support and unattended remote access software.

Assist
 
Lens

Interactive remote assistance software with augmented reality.

Lens
 
FSM

End-to-end field service management platform for service businesses.

FSM
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
Suites
Service Plus

Unified platform for customer service and support teams.

Service Plus

Finance

 
Books

Powerful accounting platform for growing businesses.

Books
 
FREE
Invoice

100% Free invoicing solution.

Invoice
 
Expense

Effortless expense reporting platform.

Expense
 
Inventory

Powerful stock management and inventory control software.

Inventory
 
Billing

End-to-end billing solution for your business.

Billing
 
Checkout

Collect payments online with custom branded pages.

Checkout
 
NEW
Payroll

Payroll software with automated tax payments and filing.

Payroll
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo
 
Practice

Practice management software for accounting firms.

Practice
 
Sign

Digital signature app for businesses.

Sign
 
Commerce

eCommerce platform to manage and market your online store.

Commerce
 
Suites
Finance Plus

All-in-one suite to manage your operations and finances.

Finance Plus

Email and Collaboration

 
Mail

Secure email service for teams of all sizes.

Mail
 
Meeting

Online meeting software for all your video conferencing & webinar needs.

Meeting
 
Writer

Word processor for focused writing and discussions.

Writer
 
Sheet

Spreadsheet software for collaborative teams.

Sheet
 
Show

Create, edit, and share slides with a sleek presentation app.

Show
 
Notebook

Beautiful home for all your notes.

Notebook
 
Cliq

Stay in touch with teams no matter where you are.

Cliq
 
Connect

Employee experience platform to communicate, engage, and build positive employee relations.

Connect
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
TeamInbox

Shared inboxes for teams.

TeamInbox
 
WorkDrive

Online file management for teams.

WorkDrive
 
Sign

Digital signature app for businesses.

Sign
 
Office Suite

Powerful collaborative work platform for teams.

Office Suite
 
Office Integrator

Built in document editors for web apps.

Office Integrator
 
ZeptoMail

Secure and reliable transactional email sending service.

ZeptoMail
 
Calendar

Online business calendar to manage events and schedule appointments.

Calendar
 
Learn

Knowledge and learning management platform.

Learn
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
ToDo

Collaborative task management for individuals and teams.

ToDo
 
Tables

Work management tool to connect people, processes, and information.

Tables
 
FREE
PDF Editor

Collaborative online PDF editing tool.

PDF Editor
 
Suites
Workplace

Application suite built to improve team productivity and collaboration.

Workplace

Human Resources

 
People

Organize, automate, and simplify your HR processes.

People
 
Recruit

Intuitive recruiting platform built to provide hiring solutions.

Recruit
 
Expense

Effortless expense reporting platform.

Expense
 
Workerly

Manage temporary staffing with an employee scheduling solution.

Workerly
 
NEW
Payroll

Payroll software with automated tax payments and filing.

Payroll
 
Shifts

Employee scheduling and time tracking app.

Shifts
 
Sign

Digital signature app for businesses.

Sign
 
Suites
People Plus

Comprehensive HR platform for seamless employee experiences.

People Plus

Security and IT Management

 
Creator

Build custom apps to simplify business processes.

Creator
 
Directory

Workforce identity and access management solution for cloud businesses.

Directory
 
FREE
OneAuth

Secure multi-factor authenticator (MFA) for all your online accounts.

OneAuth
 
Vault

Online password manager for teams.

Vault
 
Catalyst

Pro-code platform to build and deploy your apps.

Catalyst
 
Toolkit

Complete resource for any admin-related lookup queries.

Toolkit
 
Lens

Interactive remote assistance software with augmented reality.

Lens
 
Assist

Remote support and unattended remote access software.

Assist
 
QEngine

Test automation software to build, manage, execute, and report testcases.

QEngine
 
NEW
RPA

Automate manual, tedious, and repetitive tasks easily.

RPA

BI and Analytics

 
Analytics

Modern self-service BI and analytics platform.

Analytics
 
Embedded BI

Embedded analytics and white label BI solutions, tailored for your needs.

Embedded BI
 
DataPrep

AI-powered data preparation service for your data-driven organization.

DataPrep
 
NEW
IoT

Harnessing IoT analytics for real-time operational intelligence.

IoT

Project Management

 
Projects

Manage, track, and collaborate on projects with teams.

Projects
 
Sprints

Planning and tracking tool for scrum teams.

Sprints
 
BugTracker

Automatic bug tracking software for managing bugs.

BugTracker
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo

Developer Platforms

 
Creator

Build custom apps to simplify business processes.

Creator
 
Flow

Automate business workflows by creating smart integrations.

Flow
 
Catalyst

Pro-code platform to build and deploy your apps.

Catalyst
 
Office Integrator

Built in document editors for web apps.

Office Integrator
 
ZeptoMail

Secure and reliable transactional email sending service.

ZeptoMail
 
QEngine

Test automation software to build, manage, execute, and report testcases.

QEngine
 
Tables

Work management tool to connect people, processes, and information.

Tables
 
NEW
RPA

Automate manual, tedious, and repetitive tasks easily.

RPA
 
NEW
Apptics

Application analytics for all apps.

Apptics
 
Embedded BI

Embedded analytics and white label BI solutions, tailored for your needs.

Embedded BI
 
NEW
IoT

Build, deploy, and scale IoT solutions for connected businesses.

IoT
 
DataPrep

AI-powered data preparation service for your data-driven organization.

DataPrep

IoT

 
NEW
IoT

Low-code IoT platform and solutions for connected businesses.

IoT

Search Result

 
CRM Plus

Unified platform to deliver top-notch customer experience.

Try now
CRM Plus
 
Service Plus

Unified platform for customer service and support teams.

Try now
Service Plus
 
Finance Plus

All-in-one suite to manage your operations and finances.

Try now
Finance Plus
 
People Plus

Comprehensive HR platform for seamless employee experiences.

Try now
People Plus
 
Workplace

Application suite built to improve team productivity and collaboration.

Try now
Workplace
 
Marketing Plus

Unified marketing platform for marketing teams.

Try now
Marketing Plus
 
All-in-one suite

Zoho One

The Operating System for Business

Run your entire business on Zoho with our unified cloud software, designed to help you break down silos between departments and increase organizational efficiency.

TRY ZOHO ONE
Zoho One
Zoho Marketplace

With over 2000 ready-to-use extensions across 40+ categories, connect your favorite business tools with the Zoho products you already use.

EXPLORE MARKETPLACE
Marketplace
Skip to main content
This help page is for users in Creator 5. If you are in the newer version (Creator 6), click here. Know your Creator version.

JS API documentation

Download the latest JS SDK library from the CDN URL given below and link it using the script tag.

Initialize the SDK using the below method and use then block to write the logic:

ZOHO.CREATOR.init()
                .then(function() {
                  //Code goes here
               });


To get the value from the parameters configured in pages, use the below method:

var queryParams = ZOHO.CREATOR.UTIL.getQueryParams();


The values of the image field will be an API endpoint in case the image is uploaded from computer or phone, use the below method to convert the endpoint to image data and assign the value to the source of the image tag. In another case, the image can be a public image link, and this method works for both cases.

var imageTag = document.getElementById("imgtag");
        var imageURL =
        "/api/v2/zylker/Contacts/view/All_Contacts/66359000000015039/Upload/download";
        ZOHO.CREATOR.UTIL.setImageData(imageTag, imageURL, callbackFunction);

 

Widget API allows customers to push and pull data from other apps in their Creator account. The success of the API call to push or pull data in other apps depends on the permissions provided for users of that app.

Record APIs

These APIs help you perform different tasks with the records of the application. The various Record APIs are as follows:

Note: appName needs to be passed only when you need to push or pull data from other apps in your account.

Add Record

Method : addRecord

NameDescription
formNameLink name of the form to which the records to be added. Refer this page to view and change the link name.
dataForm data in json format, where the format for all the fields has been specified here.
appNameLink name of the application from which data needs to be pushed to.


Syntax :

   //configuration json
           config = {     
           appName : "${APPNAME}",
           formName : "${FORMNAME}",
                   data : "${FORMDATA}"
           } 
            //add record API
            ZOHO.CREATOR.API.addRecord(config).then(function(response){
                //callback block
           });

 

Example

    var config = { 
                   appName : "zylker"
                   formName : "timesheet", 
            ​       data : formData 
            } 
            ZOHO.CREATOR.API.addRecord(config).then(function(response){ 
                if(response.code == 3000){
                 console.log("Record added successfully");
                }
            });

 

Form data :

formData = {
                "data" : {
                    "Name": {
                        "first_name": "James",
                        "last_name": "Kyle",
                    },
                    "Address": {
                        "address_line_1": "Dari Mart",
                        "address_line_2": "Hayden Bridge Rd",
                        "district_city" : "Springfield",
                        "state_province" : "Oregon",
                        "postal_code" : "97477",
                        "country" : "United States"
                    },
                    "Rich_Text" : "The phone number is <b>+1541-726-4051</b>",
                    "Phone_Number": "+15417264051",
                    "Single_Line": "A simple one line text",
                    "Email": "james@zylker.com",
                    "Dropdown" : "Open",
                    "Radio" : "Closed",
                    "Multi_Select" : ["New", "Used"],
                    "Checkbox" : ["Refurbished", "Used"],
                    "Number": "1000",
                    "Decimal" : "1000.00",
                    "Percent": "60.00",
                    "Date_field" : "10-Jan-2020",
                    "Date_Time" : "23-Mar-2020 12:25:43 PM",
                    "Image" : "/sites/zweb/images/creator/profile-01.jpg",
                    "Ur1": {
                        "value": "Dari Mart",
                        "url": "www.darimart.com",
                        "title": "Dari mart provisional store"
                    },
                    "Lookup_Single_Select" : "521270000078464",
                    "Lookup_Multi_Select" : ["5212750000247932","5212750000564867"],
                    "SubForm" : [
                        {
                            "Single_Line" : "Service Equipment",
                            "Dropdown" : "New Order"
                        },
                        {
                            "Single_Line" : "Rotary Machine",
                            "Dropdown" : "Replacement",
                        }
                    ]
                }
            }

 

Response :

 response = {
                "code": 3000,
                "data": {        
                    "ID": "2000000245119"
                },
                "message": "success"
            }

Update Record

Method : updateRecord

NameDescription
reportNameLink name of the report through which the record to be updated. Refer here to get and update the link name of a report.
idID value of the record to be updated.
dataForm data in json format, where format for all the fields have been specified here.
appNameLink name of the application in which data needs to be updated.


Syntax

//configuration json
            config = {
                    appName : "${APPNAME}",
                reportName : "${REPORTNAME}",
                id: "${RECORDID}",
                data : "${FORMDATA}"
            }
            
            //update record API
            ZOHO.CREATOR.API.updateRecord(config).then(function(response){
             //callback block
            });

 

Example :

var config = { 
                   appName : "zylker"
                   reportName : "All-Timesheet", 
                   id : "2000000245119"
                   data : formData 
            } 
            
            ZOHO.CREATOR.API.updateRecord(config).then(function(response){
                if(response.code == 3000){
                    console.log("Record updated successfully");
                } 
            });

 

Response :

response = {
             "code": 3000,
             "data": {  
              "ID": "2000000245119"
                },
             "message": "success"
            }

Get All Records

Method : getAllRecords
Configuration :

NameDescription
reportNameLink name of the report through which the record to be updated. Refer here to get and update the link name of a report.
criteria (optional)Condition to filter the record, which is applied along with the condition specified in the report filter. The criteria must be specified in the format: {fieldlinkname} <<operator>> {fieldValue}, where fieldlinkname is the link name of the field, which compares with the respective field's value and the comparison is based on the specified operator. The supported operators are !=, <=, >=,<, >, ==. You can combine more than one criteria using logical AND (&&) and logical OR(||). Example : (Stage == "Open" && Score > 40). Learn moreis the link name of the field, which compares with the respective field's value and the comparison is based on the specified operator. The supported operators are !=, <=, >=,<, >, ==. You can combine more than one criteria using logical AND (&&) and logical OR(||). Example : (Stage == "Open" && Score > 40). Learn more
page (optional)Index or number of the page to be retrieved. The default page number is 1.
pageSize (optional)Total number of records to be retrieved in the specified page. The default size is 100 and the maximum size is 200.
appNameLink name of the application from which data needs to be pulled from.

Note :

  • The response will return the data that’s displayed in both the Quick view and Detail view of the corresponding report.
  • When the Detail view sports a related block of data, which is related via a lookup field, this API’s response will also include the data from that lookup field's display fields.

Syntax :

//configuration json
            config = {
                    appName : "${APPNAME}",
                reportName : "${REPORTNAME}",
                criteria: "${CRITERIA}",
                page : "${PAGENUMBER}",
                pageSize : "${PAGESIZE}"
            }
            
            //get all records API
            ZOHO.CREATOR.API.getAllRecords(config).then(function(response){
                //callback block
            });

 

Example :

var config = { 
                appName : "zylker"
                reportName : "All-Timesheet", 
                criteria : "(Status == \"Open\" && Priority = \"High\")",
                page : 1,
                pageSize : 10
            }
            
            ZOHO.CREATOR.API.getAllRecords(config).then(function(response){
                var recordArr = response.data;
                for(var index in recordArr){
                    console.log(recordArr[index]);
                }	
            });

 

Response :

response = {
              "code": 3000,
              "data": [
                {
                  "ID": "52129000000146011",
                  "Name": {
                    "first_name": "James",
                    "last_name": "Kyle",
                    "display_value": "James Kyle"
                  },
                  "Address": {
                    "address_line_1": "Dari Mart",
                    "address_line_2": "995 Hayden Bridge Rd",
                    "district_city": "Springfield",
                    "state_province": "Oregon",
                    "postal_code": "97477",
                    "country": "United States",
                    "latitude": "33.9307727",
                    "longitude": "-116.8767541",
                    "display_value": "Dari Mart, 995 Hayden Bridge Rd, Springfield, Oregon, United States"
                  },
                  "Rich_Text": "The phone number is <b>+1541-726-4051</b>",
                  "Phone_Number": "+15417264051",
                  "Single_Line": "A simple one line text",
                  "Email": "james@zylker.com",
                  "Number": "23",
                  "Decimal": "1000.00",
                  "Percent": "60.00",
                  "Date_field": "10-Jan-2020",
                  "Date_Time": "23-Mar-2020 12:25:43 PM",
                  "Dropdown": "Open",
                  "Radio": "Closed",
                  "Multi_Select": [
                    "New",
                    "Used"
                  ],
                  "Checkbox": [
                    "Refurbished",
                    "Used"
                  ],
                  "Image": "/sites/zweb/images/creator/profile-01.jpg",
                  "File_Upload": "/api/v2/zylker/Contacts/view/Contacts/635900380/Upload/download",
                  "Ur1": {
                    "value": "Dari Mart",
                    "url": "www.darimart.com",
                    "title": "Dari mart provisional store"
                  },
                  "Lookup_Single_Select": {
                    "display_value": "James - 4269",
                    "ID": "521270000078464"
                  },
                  "Lookup_Multi_Select": [
                    {
                      "display_value": "Door Step Delivery",
                      "ID": "5212750000247932"
                    },
                    {
                      "display_value": "Cash on Delivery",
                      "ID": "5212750000564867"
                    }
                  ],
                  "Subform": [
                    {
                      "display_value": "Service Equipment,New Order",
                      "ID": "5212750000433263"
                    },
                    {
                      "display_value": "Rotary Machine,Replacement",
                      "ID": "5212750000090778"
                    }
                  ]
                },
                {
                  //Record 2
                },
                {
                //Record 3
                }
              ]
            }

Get Specific Record Using ID

Method : getRecordById
Configuration :

NameDescription
reportNameLink name of the report through which the record to be updated. Refer here to get and update the link name of a report.
idID value of the record to be retrieved.
appNameLink name of the application from which data needs to be pulled from.

Note: 

  • The response will return the data that’s displayed in the Detail view of the corresponding report
  • When the Detail view sports a related block of data, which is related via a lookup field, this API’s response will also include the data from that lookup field's display fields.

Syntax :

//configuration json
            config = {
                    appName : "${APPNAME}",
                reportName : "${REPORTNAME}",
                id: "${RECORDID}"
            }
            
            //get specific record API
            ZOHO.CREATOR.API.getRecordById(config).then(function(response){
                //callback block
            });

 

Example :

var config = {
                   appName : "zylker"
                   reportName : "All-Timesheet", 
                   id : "2000000193171"
            } 
            
            ZOHO.CREATOR.API.getRecordById(config).then(function(response){
                console.log(response.data);
            });

 

Response :

response  = {
             "code": 3000,
             "data": {
                    "ID": "52129000000146011",
              "Name": {
                        "first_name": "James",
                        "last_name": "Kyle",
               "display_value": "James Kyle"
                      },
              "Address": {   
               "address_line_1": "Dari Mart",
                           "address_line_2": "995 Hayden Bridge Rd",
                           "district_city" : "Springfield",
                           "state_province" : "Oregon",
                           "postal_code" : "97477",
                           "country" : "United States"
               "latitude": "33.9307727",
               "longitude": "-116.8767541",
               "display_value": "Dari Mart, 995 Hayden Bridge Rd, Springfield, Oregon, United States"
              },
              "Rich_Text" : "The phone number is <b>+1541-726-4051</b>",
                      "Phone_Number": "+15417264051",
                      "Single_Line": "A simple one line text",
                      "Email": "james@zylker.com",
              "Number": "23",
                      "Decimal" : "1000.00",
              "Percent": "60.00",
                      "Date_field" : "10-Jan-2020",
                      "Date_Time" : "23-Mar-2020 12:25:43 PM",
              "Dropdown" : "Open",
                      "Radio" : "Closed",
                      "Multi_Select" : ["New", "Used"],
                      "Checkbox" : ["Refurbished", "Used"],
                    "Image" : "/sites/zweb/images/creator/profile-01.jpg",
                    "File_Upload" : "/api/v2/zylker/Contacts/view/Contacts/635900380/Upload/download",
              "Ur1": {
                           "value": "Dari Mart",
                           "url": "www.darimart.com",
                           "title": "Dari mart provisional store"
                      },
              "Lookup_Single_Select" : {
                        "display_value" : "James - 4269",
               "ID" : "521270000078464"
               
              },
              "Lookup_Multi_Select" : [{
               "display_value" : "Door Step Delivery",
                        "ID" : "5212750000247932"
              },
              {
               "display_value" : "Cash on Delivery",
                        "ID" : "5212750000564867"   
              }],
                 "Subform" : [{    
               "display_value" : "Service Equipment,New Order",
                        "ID" : "5212750000433263"
              },
              {   
                           "display_value" : "Rotary Machine,Replacement",
                        "ID" : "5212750000090778"
              }]  
             }
            }

Get Record Count

Method : getRecordCount
Configuration

NameDescription
reportNameLink name of the report for which the record count is required. Refer here to get and update the link name of a report.
appNameLink name of the application from which data needs to be pulled from and counted.
criteria
(optional)
Condition to count the record, which is applied along with the condition specified in the report filter.
 

Note: The response will return the count of the number of records in corresponding report​

Syntax :

//configuration json
            config = {
                appName: "first-application",
                reportName: "Form_Report",
                criteria: "(Single_Line = \"High\")" //optional
            }
            
            ZOHO.CREATOR.API.getRecordCount(config).then(function (response) {
                //your code goes here.
            });

 

Example :

var config = {
                   appName : "zylker"
                   reportName : "All-Timesheet", 
            } 
            
            ZOHO.CREATOR.API.getRecordCount(config).then(function (response){
                console.log(response);
            });

 

Response :

response  =
            {
                 "result": {
                        "records_count": "4"
                  },
                  "code": 3000
            }

Delete Record

Method : deleteRecord
Configuration

NameDescription
reportNameLink name of the report through which the record to be updated. Refer here to get and update the link name of a report.
criteriaCondition to filter the record, which is applied along with the condition specified in the report filter. The criteria must be specified in the following format:
<Field Name> <Operator> <Value>

<Field name> is the link name of the field, which compares with the<Value> and the comparison is based on the <Operator>. The supported operators are !=, <=, >=,<, >, ==

You can combine more than one criteria using logical AND (&&) and logical OR(||)
Example : (Stage == "Open" && Score > 40)
appNameLink name of the application from which data needs to be deleted.
Note: The maximum of 200 records can be deleted for every API call and you will receive error when the number of records exceeds 200.

Syntax :

//configuration json
            config = {
                    appName : "${APPNAME}",
                reportName : "${REPORTNAME}",
                criteria: "${CRITERIA}"
            }
            
            //delete record API
            ZOHO.CREATOR.API.deleteRecord(config).then(function(response){
                //callback block
            });

 

Example :

var config = { 
                   appName : "zylker"
                   reportName : "All-Timesheet", 
                   criteria : "(Status == \"Invalid\" && Date '01-01-2019')"
            } 
            
            ZOHO.CREATOR.API.deleteRecord(config).then(function(response){
                console.log("Record has been deleted");
            });

 

Response :

response = {
                "result": [{
                    "code": 3000,
                    "data": {
                        "ID": "66359000000021016"
                      },
                    "message": "success"
                   },
                   {
                   "code": 3000,
                   "data": {
                       "ID": "66359000000024309"
                     },
                   "message": "success"
                  }
                ],
                "code": 3000
            }

Upload File

Method : uploadFile
Configuration

NameDescription
reportNameLink name of the report through which the record to be updated. Refer here to get and update the link name of a report.
idID value of the record where the file to be uploaded.
fieldName

Link name of the field to which the file has to be uploaded. Refer here to get the link name of the field. The allowed field types are ImageFile UploadAudioVideo, Signature

In case the file has to be uploaded to a field which has been added inside a subform, the fieldName will be subform field link name followed by the field link name of the field to be uploaded with (dot) in between. Example: ${SUBFORMFIELDNAME.FIELDNAME}

fileIt is a javascript File object to be uploaded. Refer here to know more about javascript File API.
parentIdIn case the file has to be uploaded to a field which has been added inside a subform, then the parentId is the ID value of the parent record, i.e the main form record in which the subform has been embedded.
appNameLink name of the application in which data needs to be uploaded.
Note: The file can be uploaded only after submitting a record and this API will upload one file to one field at a time. In case of more number of fields in a form, this API need to call for each field separately.

Syntax :

//configuration json
            config = {
                    appName : "${APPNAME}",
                reportName : "${REPORTNAME}",
                id: "${RECORDID}",
                    fieldName : "${SUBFORMFIELDNAME.FIELDNAME}",
                parentId : "${RECORDID}",
                    file : "${FILEOBJECT}"
            }
            
            //upload file API
            ZOHO.CREATOR.API.uploadFile(config).then(function(response){
             //callback block
            });

 

Example :


            var fileObject = document.getElementById("fileInput").files[0];
            
        var fileObject = document.getElementById("fileInput").files[0];
            
            var config = { 
                    appName : "zylker"
                reportName : "All-Timesheet", 
                id : "2000000193171",
                fieldName : "Attachments",
                file : fileObject
            } 
            
            ZOHO.CREATOR.API.uploadFile(config).then(function(response){
             console.log("File uploaded successfully");
            });

 

Response :

response = {
              "code": "3000",
              "data": {
                "filename": "Rental Agreement-March.pdf",
                "filepath": "1587402896598_Rental_Agreement-March.pdf",
                "message": "success"
              }
            }

Read File

Method : readFile
Configuration :

NameDescription
reportNameLink name of the report through which the record is to be read. Refer here to get and update the link name of a report.
idID value of the record where the file to be read.
fieldName

Link name of the field to which the file has to be read. Refer here to get the link name of the field. The allowed field type is File Upload.

In case the file has to be read to a field which has been added inside a subform, the fieldName will be subform field link name followed by the field link name of the field to be read with (dot) in between. Example: ${SUBFORMFIELDNAME.FIELDNAME}

parentIdIn case the file has to be read to a field which has been added inside a subform, then the parentId is the ID value of the parent record, i.e the main form record in which the subform has been embedded.
appNameLink name of the application in which data needs to be read.
Note: The file can be read only after uploading a file and submitting that record. This API can read only one file at a time. In case of multiple file upload fields in a form, this API need to call each field separately.

Syntax :

//configuration json
config = {
	reportName : "${REPORTNAME}",
	id: "${RECORDID}",
        fieldName : "${SUBFORMFIELDNAME.FIELDNAME}",
	parentId : "${RECORDID}"
}
//read file API
ZOHO.CREATOR.API.readFile(config).then(function(response){
 //callback block
});

 

Example :

var config = { 
        appName : "zylker"
	reportName : "All-Timesheet", 
	id : "2000000193171",
	fieldName : "Attachments",
} 
ZOHO.CREATOR.API.readFile(config).then(function(response){
 console.log("File read successfully");
});

 

Response :

The response returns the content of the file that requires to be read.

response = {
 "code" = "3000",
"value" = "#f00"
}

Preview image API

Users can preview the uploaded images from their Zoho Creator applications' records using the setImageData API. Below is the API format:

ZOHO.CREATOR.UTIL.setImageData(<imageElement>,<imageUrlFromGetRecordAPI>);

Example:

<img id="image" src="#" alt="Image from Get Record(s) API" width="500" height="600">
var imageTag = document.getElementById("image");
var imageFromGetRecordsAPI = "api/v2/zylker/Contacts/view/All_Contacts/66359000000015039/Upload/download"
ZOHO.CREATOR.UTIL.setImageData(imageTag,imageFromGetRecordsAPI);

Related Topics

Still can't find what you're looking for?

Write to us: support@zohocreator.com