Salesforce input format

Salesforce Input Format

The Salesforce Create Service and Update Producer both might require you to specify field values. This raises two immediate issues:

  1. What is the internal Salesforce name of the field?
  2. How should the value of the field be formatted?

Object and field names

In order to use the Salesforce components, you will need to know the internal names of the Salesforce objects and fields. These names often do not coincide with how they are presented in Salesforce’s frontend.

One option is to use the Salesforce Workbench. Note that Workbench is not an officially supported Salesforce product (see the About section in Workbench for more information).

  1. Start by logging in at https://workbench.developerforce.com/login.php.
  2. Go to Info > Standard & Custom Objects.
  3. Here you can select the object you wish to interact with as well as see the fields and their properties. Note that you should use a field’s name and not its label. Furthermore, the field properties also list type information that might be interesting to a user. For example, the precision of fields of type double and the soap type of currency (double).

 

A second option is to obtain this information from the Salesforce Lightning Platform, i.e., the standard environment after logging in at https://login.salesforce.com. The following assumes you are not using Salesforce Classic.

  1. Start by logging in at https://login.salesforce.com.
  2. Click on the cog icon and go to Setup.
  3. Click on the Object Manager tab.
  4. Select the object you wish to get info on.
  5. Select Fields & Relationships in the sidebar. Note that you should use the names from the “Field Names” column and not the ones from the “Field Label” column.

Field Data Formatting

Different fields might have different data types. In most cases you can simply pass the desired field values in plain text without any special formatting. However there are some field types that have some special requirements.

Binary Data

The data should be base64 encoded before being passed on to the Salesforce connector.

DateTime, Date and Time

DateTime is used to specify both a date and a time and follows the following format:

YYYY-MM-DDThh:mm:ss.SSSTZD

with

Value Description
Y Year
M Month
D Day
h Hour
m Minute
s Second
S Millisecond
TZD ‘Z’, ‘+hh:mm’ or ‘-hh:mm’

Note that although you can add milliseconds, they will be discarded.

TODO: add example

Similarly, date and time can be expressed as YYYY-MM-DD and hh:mm:ss.sss, respectively.

See Date and Time Formats for a slightly more elaborate description of the exact format.

Picklist and Multipicklist

Some fields have type picklist. This means that they can only be set to a value selected from a predefined set of values. You can simply pass this value as a string. For example,

TODO: add example

There is also the type multipicklist. In this case a field can be set to multiple predefined values. In order to pass the correct values to such a field you need to separate the individual values with a semicolon “;”.

Setting Fields to Null

You may want to reset certain fields to an empty value if the field type allows such a thing. In this case you can simply pass the value “null” to the field.

TODO: Number localization, e.g. 3.14 vs 3,14.

TODO: API Data Types and Salesforce Field Types