Skip to main content

Salesforce

To generate Salesforce data, make sure to specify the dialect as salesforce in your data plan file.

salesforce.plan.yaml
name: "sf_type_map_plan"
dialect: "salesforce"

Supported Data Types

The supported data types for Salesforce are:

Salesforce Data TypeMapped Type
Checkboxboolean
Currencynumber with constraints
Datedate
Date/Timedatetime
Emailtext with constraints
Numbernumber
Percentnumber with constraints
Phonetext with constraints
Picklisttext with values
Texttext
Timetime
URLtext with constraints

Sample Data Order

Checkbox

Salesforce checkbox data type is mapped by a boolean data type.

Checkbox
properties:
- name: "My_CheckBox__c"
type: "boolean"

Currency

Salesforce currency data type is mapped by a number data type with precision constraint.

Currency
# A currency amount with 2 digits of precision, such as dollar
properties:
- name: "My_Currency__c"
type: "number"
constraints:
- type: "precision"
max: 2

Date

Salesforce date data type is mapped by a date data type.

Date
properties:
- name: "My_Date__c"
type: "date"

Date/Time

Salesforce date/time data type is mapped by a datetime data type.

Date/Time
properties:
- name: "My_DateTime__c"
type: "datetime"

Email

Salesforce email data type is mapped by a text data type with our email data provider(one of category constraint).

Email
properties:
- name: "My_Email__c"
type: "text"
constraints:
- type: "category"
name: "email"

Number

Salesforce number data type is mapped by a number data type. For non-integer number, you need to apply the precision constraint too.

Number
properties:
- name: "My_Number__c"
type: "number"
constraints:
- type: "precision"
max: 3

Percent

Salesforce percent data type is mapped by a number data type with both precision and range constraints.

Percent
properties:
- name: "My_Percent__c"
type: "number"
constraints:
- type: "range"
min: 0
max: 100
- type: "precision"
max: 2

Phone

The Salesforce phone data type is mapped by a text data type. Although we don’t have a built-in phone provider, it can be easily implemented using an ID provider with a specific format.

Phone
properties:
- name: "My_Phone__c"
type: "text"
constraints:
- type: "category"
name: "id"
- type: "format"
format: "(###) ###-####"
tip

For more advanced way to generate phone number, you can use join function provided by string alternation instead.

Picklist

The Salesforce picklist data type is mapped by a text data type, and the picklist values are listed using value distribution.

List Values in Plan File
properties:
- name: "My_Pick__c"
values:
- values:
- "val1"
- "val2"
- "val3"
weight: 1.0

Text

The Salesforce text data type is mapped by a text data type.

Text
properties:
- name: "My_Text__c"
type: "text"

Time

The Salesforce time data type is mapped by a time data type.

Time
properties:
- name: "My_Time__c"
type: "time"

URL

The Salesforce phone data type is mapped by a text data type. Though we don't have a url provider, the value can be generated by using an ID provider with a specific format.

URL
properties:
- name: "My_URL__c"
type: "text"
constraints:
- type: "category"
name: "id"
- type: "format"
format: "https://www.?????????.com"
tip

For more advanced way to generate url, you can use join function provided by string alternation instead.