rikas / zoho_hub

Zoho CRM API V2 Wrapper
MIT License
25 stars 30 forks source link

Attribute types #31

Open artsyca opened 5 years ago

artsyca commented 5 years ago

Strictly speaking we're using Zoho as an alternative data source for models that would typically be stored using ActiveRecord. This plugin has great promise of course but at present it treats all fields like text which is challenging when it comes to formats like dates, it would be helpful to support the various attribute types more organically

rikas commented 5 years ago

Can you give an example? Also, if you could provide with information on which types Zoho supports it would be great!

artsyca commented 5 years ago

There are several field types available in Zoho CRM, I'll document them here along with associated data types

Field Name (in CRM) Data Type (in API) Example (JSON key/value)
Single Line Single Line "single_line": "Single Line",
Multi-Line (Small - 2000 Characters) Multi Line (Small) "multi_line_small": "Multi Line\\nMulti Line\\nMulti Line",
Multi-Line (Large - 32000 Characters) Multi Line (Large) "multi_line_large": "Multi Line\\nMulti Line\\nMulti Line ...",
Email Email "Email": "axxx@xxxxx.ca",
Phone Phone "phone": "5551212",
Pick List Pick List "pick_list": "Option 2",
Multi-Select Multiselect "multi_select": ["Option 1", "Option 2", "Option 3"],
Date Date "date": "2019-09-02",
Date/Time DateTime "date_time": "2019-09-26T12:30:00-04:00",
Number Number "number": 99999,
Auto-Number Auto Number "auto_number": "Prefix1Suffix",
Currency Currency "currency_field": 10000.99,
"$currency_symbol": "$",
Decimal Decimal "decimal": 99.1,
Percent Percent "percent": 88.5,
Long Integer Long Integer "long_integer": "999999999999999999",
Checkbox Boolean "checkbox": true,
URL URL "url": "url.ca",
Lookup Lookup "contact_lookup": {
"name": "Alexandros K",
"id": "3xxxxxxxxxxxxxxxxx2"
},
Formula
User UserLookup "user_lookup_single": {
"name": "Gopi C",
"id": "3xxxxxxxxxxxxxxxxx6"
}
Subform Subform Subform is a peculiar beast in its own right, consisting of an array of the above

There are a couple of other fields too, File Upload and Multi Select Lookup which I'm not quite sure about

artsyca commented 5 years ago

Here's an example payload, containing the full response from the API -> https://gist.github.com/artsyca/4b625278a3977f113e35aa3efeb57b72