Difference between revisions of "REST API:Field Type Reference"

From AgileApps Support Wiki
imported>Aeric
imported>Aeric
 
(32 intermediate revisions by the same user not shown)
Line 1: Line 1:
This table shows how to format data for each of the [[Field Display Types]] in a platform object, when using the [[REST API]].
This table shows how to format input data for the various [[Field Display Types]] in platform objects when using the [[REST API]].


{| border="1" cellpadding="5" cellspacing="0"  
{| border="1" cellpadding="5" cellspacing="0"  
Line 8: Line 8:
| Auto Number
| Auto Number
|
|
n/a
n/a (read only)


|-
|-
Line 18: Line 18:
| Currency
| Currency
|
|
Specify a decimal value, with no currency symbol and no separators other than the decimal point.  
* Specify a value in [[Database Format]], with no currency symbol and no separators other than the decimal point.  
 
|-
| [[Custom Control]]
|
n/a


|-
|-
| [[Date Format|Date]]  
| [[Date Format|Date]]  
|
|
A date. See "Date time", below.
* A date in [[UTC Format]].
* The field definition determines how the value is stored.


|-
|-
| [[Date Format|Date time]]  
| <span id="Date_time">[[Date Format|Date time]]<span>
|  
|  
<span id="Date_time">A date and time.<span>
* A date and time in [[UTC Format]].
{{:Common:Date_Time_Display_Types}}
* The field definition determines how the value is stored.


|-
|-
| [[Dependent Picklist]]
| [[Dependent Picklist]]
|
|
n/a
* Specify one of the picklist values.
* An error is thrown if the list (determined by the parent-field dependency) doesn't include that value.


|-
|-
| Email Address  
| Email Address  
|  
|  
A string containing of the form {name}@{domain}.{type}. Example: friend@somewhere.com
* A string containing text in email-address format. For example: <tt>friend@somewhere.com</tt>
 
|-
| [[External Lookup]]
|
n/a


|-
|-
| File Field  
| File Field  
|  
|  
To upload a file, use the [[...]]
* To upload a file, do a [[REST API:record Resource#Multipart Operations for Raw Data|Multipart]] REST request


|-
|-
Line 55: Line 57:
|
|
n/a
n/a
|-
| Geolocation
|
A string containing a latitude and longitude, separated by a comma and a space.<br>Ex: <tt>37.403930662906106, -121.97971165820213</tt>


|-
|-
| [[Global Picklist]]
| [[Global Picklist]]
|
|
Specify a picklist value.
* Specify a picklist value.


|-
|-
| <span id="image">Image Field</span>
| <span id="image">Image Field</span>
|
|
To upload an image file, use the [[...]]
* To upload an image, do a [[REST API:record Resource#Multipart Operations for Raw Data|Multipart]] REST request


|-
|-
| [[Lookup]]
| 1:N [[Lookup]]
|
|
Specify a record ID from the target object.
* Applies to a Lookup field in a One-to-Many relationship
* Specify a record ID from the target object.
 
|-
| M:N [[Lookup]]
|
* Applies to a Lookup field in a Many-to-Many relationship
* Specify a comma separated list of record IDs from the target object.


|-
|-
| [[Multiple Checkboxes]]
| [[Multiple Checkboxes]]
|
|
A comma-separated list of checkbox values.
* A comma-separated list of checkbox values.


|-
|-
| [[Multi Object Lookup]]
| [[Multi Object Lookup]]
|
|
The format is <tt>objectName:recordID</tt>. For example: <tt>cases:12345678</tt>
* The format is <tt>objectName:recordID</tt>. For example: <tt>cases:12345678</tt>
* The JSON format of Multi Object Lookup value is <tt>@type:objectName</tt> and <tt>content:recordID</tt>.
:For example:
:"related_to": {
:"@type": "cases",
:"content": "1513449967"
:}


|-
|-
| [[Multi Select Picklist]]  
| [[Multi Select Picklist]]<br>&<br>Multi Select Global Picklist
(Multi Select Global Pick List)
|
|
A comma-separated list of picklist values.
* A comma-separated list of picklist values.


|-
|-
| Number
| Number
|  
|  
An integer from -2,147,483,646 to 2,147,483,647.
* An integer from -2,147,483,646 to 2,147,483,647. Must be in [[Database Format]], with no group separators (commas).


|-
|-
| Number with decimals
| Number with decimals
|  
|  
A number with a decimal point (and no other separators). The number of decimal places is specified in the field definition.  
* A number in [[Database Format]], with a decimal point (and no other separators). The number of decimal places is specified in the field definition.  


|-
|-
| Percentage
| Percentage
|  
|  
A decimal value in the range 0 to 1. The number of decimal places is specified in the field definition.  
* A decimal value in the range 0 to 1, in [[Database Format]]. The number of decimal places is specified in the field definition.  


|-
|-
| Phone/Fax
| Phone/Fax
|  
|  
A string of digits, with or without formatting. (Formatting this supplied is preserved.  For example, "123.456.7890". Digits entered without formatting are displayed in the default format:  
{{:Phone Format}}
:* 7 digits ("1234567") displays as "123-4567".
:* 10 digits "1234567890" displays as "(123) 456-7890".
:* 11 digits ("12345678901") displays 1-234-567-8901
 
:''Note:''<br>If the string is longer than 11 digits, it is displayed as entered.<br>In that case, it's helpful to provide the desired formatting.


|-
|-
| [[Picklist]]
| [[Picklist]]
|
|
*Specify one of the picklist values.
* Specify one of the picklist values.
{{:Common:SpecifyingEnumerationValues}}


|-
|-
| Radio Buttons
| Radio Buttons
|
|
Specify one of the radio button values.
* Specify one of the radio button values.
{{:Common:SpecifyingEnumerationValues}}


|-
|-
| Rich Text Area
| Rich Text Area
|
|
*A string containing text and a limited number of HTML tags:
* A string containing text and HTML tags
*: '''bold''', ''italics'', numbered lists, bullet lists, image tags
* Linebreaks can be encoded using <tt>\n</tt> (newline) to make the code readable
* <tt><nowiki><wbr></nowiki></tt> and <tt><nowiki></wbr></nowiki></tt> tags are not supported, as they are problematic when switching between edit and display modes. (To prevent issues, those tags are removed before the content is displayed.)


|-
|-
| Text Area
| <span id="text_area">Text Area</span>
|
|
* A multi-line string that can contain alphanumerics (A-Z, a-z, 0-9) and special characters: <tt> / @ . - $ % </tt>
* A multi-line string containing alphanumerics (A-Z, a-z, 0-9) and special characters: <tt> / @ . - $ % </tt>.
* Linebreaks can be encoded using <tt>\n</tt> (newline)


|-
|-
| Text Field ||
| Text Field ||
* A string containing a single line of text. Text can include alphanumerics (A-Z, a-z, 0-9) and special characters: <tt> / @ . - $ % </tt>
* A string containing alphanumerics (A-Z, a-z, 0-9) and special characters: <tt> / @ . - $ % </tt>


|-
|-
| [[Date Format|Time]]  
| [[Date Format|Time]]  
|  
|  
A time. For example, "6:50 PM".
* A time in [[UTC Format]].
{{:Common:Date_Time_Display_Types}}
* The field definition determines how the value is stored.


|-
|-
| URL || A string containing a web address. For example: http://yourCompany.com
| URL  
|
* A string containing a web address. For example: http://yourCompany.com
 
|}
|}
<noinclude>
<noinclude>

Latest revision as of 11:18, 27 October 2016

This table shows how to format input data for the various Field Display Types in platform objects when using the REST API.

Field Display Types Description
Auto Number

n/a (read only)

Checkbox
  • Specify 1 for Yes/True, 0 for No/False
Currency
  • Specify a value in Database Format, with no currency symbol and no separators other than the decimal point.
Date
  • A date in UTC Format.
  • The field definition determines how the value is stored.
Date time
  • A date and time in UTC Format.
  • The field definition determines how the value is stored.
Dependent Picklist
  • Specify one of the picklist values.
  • An error is thrown if the list (determined by the parent-field dependency) doesn't include that value.
Email Address
  • A string containing text in email-address format. For example: friend@somewhere.com
External Lookup

n/a

File Field
  • To upload a file, do a Multipart REST request
Formula

n/a

Geolocation

A string containing a latitude and longitude, separated by a comma and a space.
Ex: 37.403930662906106, -121.97971165820213

Global Picklist
  • Specify a picklist value.
Image Field
  • To upload an image, do a Multipart REST request
1:N Lookup
  • Applies to a Lookup field in a One-to-Many relationship
  • Specify a record ID from the target object.
M:N Lookup
  • Applies to a Lookup field in a Many-to-Many relationship
  • Specify a comma separated list of record IDs from the target object.
Multiple Checkboxes
  • A comma-separated list of checkbox values.
Multi Object Lookup
  • The format is objectName:recordID. For example: cases:12345678
  • The JSON format of Multi Object Lookup value is @type:objectName and content:recordID.
For example:
"related_to": {
"@type": "cases",
"content": "1513449967"
}
Multi Select Picklist
&
Multi Select Global Picklist
  • A comma-separated list of picklist values.
Number
  • An integer from -2,147,483,646 to 2,147,483,647. Must be in Database Format, with no group separators (commas).
Number with decimals
  • A number in Database Format, with a decimal point (and no other separators). The number of decimal places is specified in the field definition.
Percentage
  • A decimal value in the range 0 to 1, in Database Format. The number of decimal places is specified in the field definition.
Phone/Fax

If a string of digits is entered without formatting, that is the way it appears when editing, but the numbers are automatically formatted when the field is displayed:

  • 7 digits ("1234567") displays as "123-4567".
  • 10 digits "1234567890" displays as "(123) 456-7890".
  • 11 digits ("12345678901") displays 1-234-567-8901
Note:
If the field has more than 11 digits, they are displayed as entered.
In that case, it's helpful to provide the desired formatting.

Free-format text is displayed exactly as entered. For example:

  • 123.456.7890
  • 1-800-COMPANY
  • +44 7123 456 789
Picklist
  • Specify one of the picklist values.
Radio Buttons
  • Specify one of the radio button values.
Rich Text Area
  • A string containing text and HTML tags
  • Linebreaks can be encoded using \n (newline) to make the code readable
  • <wbr> and </wbr> tags are not supported, as they are problematic when switching between edit and display modes. (To prevent issues, those tags are removed before the content is displayed.)
Text Area
  • A multi-line string containing alphanumerics (A-Z, a-z, 0-9) and special characters: / @ . - $ % .
  • Linebreaks can be encoded using \n (newline)
Text Field
  • A string containing alphanumerics (A-Z, a-z, 0-9) and special characters: / @ . - $ %
Time
  • A time in UTC Format.
  • The field definition determines how the value is stored.
URL