Example of using Salesforce package and record variable
- Updated: 2023/11/03
Example of using Salesforce package and record variable
Build a bot that queries Salesforce objects and writes data to a CSV file. The bot also uses a record variable to retrieve data from individual records fetched from Salesforce.
Prerequisites
- Set up a connected app in Salesforce if you do not have one already.
- This bot uses the Control Room OAuth connection method. Create a Control Room OAuth connection before you begin to build the bot. For more information, see Salesforce Authentication action.
- Set up sample opportunity and accounts data in Salesforce. If you do not have sample data, you can import the data from the following CSV files into Salesforce:
Suppose that the Sales team at Acme Solutions Pvt Ltd decides to automate the process of
getting all opportunity records with the prospecting status and then assigning them
to sales representatives to follow up. The team builds a bot that
performs the following tasks:
- Fetches all opportunities with the Prospecting status from the Opportunity object in Salesforce.
- Fetches the Account name from the Account object using the Account id retrieved from each opportunity record.
- Uses a record to capture data from individual opportunity records.
- Writes the records to a CSV file, which can be further processed to assign sales reps.
The sample bot uses the Salesforce, Record, Loop, and Data Table
packages along with record variables to show how to perform the
following automation tasks:
- Queries a Salesforce object using the Salesforce Execute SOQL action.
- Get an individual record from a Salesforce object using the Salesforce Get record action.
- Update record variables and reset record variables.
- Insert records into a Data Table variable.
- Write a Data Table to a CSV file.