Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@martyychang
Created January 24, 2020 16:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martyychang/29693abe3152bd42a43aa6987db3fcf8 to your computer and use it in GitHub Desktop.
Save martyychang/29693abe3152bd42a43aa6987db3fcf8 to your computer and use it in GitHub Desktop.
Expected input objects for Salesforce "batch create records" and "batch update records" actions in Tray.io
// You can reference the input variables using input.NAME
exports.step = function(input) {
return _.map(input.rows, function(row) {
// Please note that the format of this object is different
// from the format for the "Batch update records" operation.
return [
{
"key": "Role__c",
"value": row.role
},
{
"key": "AccountId",
"value": row.account_id
},
{
"key": "FirstName",
"value": row.first_name
},
{
"key": "LastName",
"value": row.last_name
},
{
"key": "Email",
"value": row.email
}
];
});
};
// You can reference the input variables using input.NAME
exports.step = function(input) {
return _.map(input.rows, function(row) {
return {
"object_id": row.contact_id,
"fields": [
{
"key": "Role__c",
"value": row.role
}
]
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment