Created
January 24, 2020 16:28
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 | |
} | |
]; | |
}); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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