Zoho Creator provides JS API tasks that allow you to perform CRUD operations from within the
widgets inserted in an application's
page component. They also let you add and manipulate data in other applications in the same Creator account. In other words, these tasks are a wrapper to the Creator
REST APIs. The success of the API call to perform a task in an application depends on the
permissions provided for the users who access the widget in the target application.
The two JS API versions available are:
Example - Say you want to create a uniquely customized form of the feedback matrix review type. This can be achieved by building it as a widget and inserting it in your page. Since this form is situated inside the widget, you will need to perform JS API tasks if you want to manipulate application data.
2. Use Cases
Add and Update Records in the Same Application - Say you've inserted a timer widget in a
Project Management application. When an employee starts working on a project, they click the
Start button in the widget. This adds a record to the
Project Timeline form. When the employee completes the project and clicks the
Finish Project button, the same record is updated with the end timeline. This is achieved using the
Add Records and
Update Records JS API tasks respectively.
3. JS API Configuration
To write the JS API tasks within your widget, you need to perform the following configurations.
STEP 1 : To Be Done in Widget ZIP's HTML File
Include the CDN URL given below by linking it in the script tag of the widget's HTML file. This HTML file will be created automatically when you create a widget ZIP.
- <script src="CDN URL"></script>
You will have created a JS file inside your widget ZIP to include interactive elements. Use block to write the logic for the JS API tasks in the same file.
5. Util APIs