Value Lists with REST API
SaveToDB 10 allows configuring REST API services in a database as shown in Getting Data Using REST API and Saving Data Using REST API.
In short, the configuration looks like this:
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 has the same configuration features as other native database objects.
So, developers can configure value lists using the xls.handlers table.
Moreover, you can mix fixed values, values from a database, and values from the underlying data service.
Here is a sample:
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> |
Where the HTTP request looks like
https://www.zohoapis.com/crm/v2/Accounts?fields=Account_Name
Creating such configurations can be time-consuming.
We recommend loading service metadata using the SELECT queries described in the HTTP Commands topic.
Doing this way, you can select the required columns only in the right order to copy data easily.