Salesforce
To generate Salesforce data, make sure to specify the dialect
as salesforce
in your data plan file.
name: "sf_type_map_plan"
dialect: "salesforce"
Supported Data Types
The supported data types for Salesforce are:
Salesforce Data Type | Mapped Type |
---|---|
Checkbox | boolean |
Currency | number with constraints |
Date | date |
Date/Time | datetime |
text with constraints | |
Number | number |
Percent | number with constraints |
Phone | text with constraints |
Picklist | text with values |
Text | text |
Time | time |
URL | text with constraints |
Sample Data Order
Checkbox
Salesforce checkbox data type is mapped by a boolean data type.
properties:
- name: "My_CheckBox__c"
type: "boolean"
Currency
Salesforce currency data type is mapped by a number data type with precision constraint.
# 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.
properties:
- name: "My_Date__c"
type: "date"
Date/Time
Salesforce date/time data type is mapped by a datetime data type.
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).
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.
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.
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.
properties:
- name: "My_Phone__c"
type: "text"
constraints:
- type: "category"
name: "id"
- type: "format"
format: "(###) ###-####"
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.
- Define Picklist Field
- List Picklist Values
properties:
- name: "My_Pick__c"
type: "text"
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.
properties:
- name: "My_Text__c"
type: "text"
Time
The Salesforce time data type is mapped by a time data type.
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.
properties:
- name: "My_URL__c"
type: "text"
constraints:
- type: "category"
name: "id"
- type: "format"
format: "https://www.?????????.com"
For more advanced way to generate url, you can use join function provided by string alternation instead.