Value Lists with REST API
SaveToDB 10 lets you configure REST API services in a database, as detailed in Getting Data Using REST API and Saving Data Using REST API.
Here's a quick overview of the configuration:
ID | TABLE_SCHEMA | TABLE_NAME | TABLE_TYPE | TABLE_CODE | INSERT_OBJECT | UPDATE_OBJECT | DELETE_OBJECT |
---|---|---|---|---|---|---|---|
ZohoCRM | Contacts | HTTP | https://www.zohoapis.com/crm/v2/Contacts | POST {$url}
{"data":[{@json_row_values}]} | PUT {$url}/{id}
{"data":[{@json_row_values}]} | DELETE {$url}/{id} |
The configured ZohoCRM.Contacts
object shares the same configuration features as other native database objects.
Developers can set up value lists using the xls.handlers table.
You can combine fixed values, values from a database, and values from the underlying data service.
Here’s an example:
ID | TABLE_SCHEMA | TABLE_NAME | COLUMN_NAME | EVENT_NAME | HANDLER_SCHEMA | HANDLER_NAME | HANDLER_TYPE | HANDLER_CODE |
---|---|---|---|---|---|---|---|---|
ZohoCRM | Contacts | Salutation | ValidationList | VALUES | -None-,Mr.,Mrs.,Dr.,Prof. | |||
ZohoCRM | Contacts | Lead_Source | ValidationList | ZohoCRM | xl_list_lead_sources | VIEW | ||
ZohoCRM | Contacts | Account_Name | ValidationList | ZohoCRM | xl_list_account_names | HTTP | <HTTP request> |
The HTTP request for the Account_Name
looks like this:
https://www.zohoapis.com/crm/v2/Accounts?fields=Account_Name
Creating these configurations can be time-consuming.
To streamline the process, we recommend loading service metadata using the SELECT queries described in the HTTP Commands topic.
This approach allows you to select only the required columns in the correct order, making data copying easier.