Create and Delete an account in Salesforce using REST Snaps
This use case demonstrates how you can use REST Snaps to create an account in Salesforce and delete it using REST Snaps.
CAUTION: The excerpt 'KI_use_HTTP_client_instead' was not found in the space
'SD' or you may not have the necessary permissions to access it.
Warning: To use this example, you need at least an account in the free
version of Salesforce. To create a Salesforce account, see Salesforce Developers.
Creating the Pipeline
.jpg)
- In the JSON Generator Snap, you enter a name for the account that you want to
create. In this example, you create an account called
Test Account..jpg)
- You configure the REST Post Snap to create an account in your Salesforce
instance using the account-name string of your choice. To do so:
- You use the URL provided by Salesforce for managing the accounts available in your instance.
- You use
$in the HTTP entity field to specify that you want to use the string coming from the Snap upstream. - You add an HTTP header to the Snap, instructing Salesforce to read the document coming in as a JSON file.
.jpg)
- You click the Account tab and select the account that you want to use with the Snap.
-
.jpg)
- You save your changes and close the Snap. When you validate the Snap, it creates
an account in your Salesforce instance and displays the following output:
.jpg)
The id field lists out the unique identifier of the new account created by the Snap.
You now want to delete the account that you just created. To do so, you need to
isolate the account ID from the REST Post Snap's output. You use a Mapper for this
task.
.jpg)
.jpg)
Upon validation, the Mapper Snap offers the following output:
.jpg)
.jpg)
You now use the REST Delete Snap to delete the newly created account:
.jpg)
.jpg)
When the Snap is executed, the account is deleted.
.jpg)