The underlying use case of the Export Salesforce Leads to Google Spreadsheet scenario is that you get details of your new leads' accounts from Salesforce, add that information to a Google spreadsheet, and then send an email alert regarding the lead creation to the relevant stakeholders. This section explains how to modify this default scenario as follows:
- Change the information that you retrieve from Salesforce about new leads.
- Edit the default email template that you send to stakeholders regarding new leads.
- Change the default time duration of the scheduled task that checks whether new leads have come.
Let's get started.
Open the project's artifacts
Download and install WSO2 EI tooling.
Download this ZIP file to your machine and unzip it.
Open the EI tooling interface. The workspace is any folder in your local file system where your tooling artifacts will be saved. For example,
Once the workspace opens, click the File -> Import menu from the menu bar and then under the General drop-down, click Existing Projects into Workspace.
Select the source folder that you downloaded earlier in step 2 as the root directory, select all the projects inside the directory, and click Finish.
Let's import the required connectors to the project.
SalesforceLeadsToGoogleProjectand click Add or Remove Connector.
Select Add connector and click Next.
Connect to the WSO2 Store using the Connector store location option and select the following connectors from the list once the available connectors load.
You have now created a tooling project using the downloaded artifacts. Next, let's modify the artifacts to our requirements.
Modify the project's artifacts
SalesforceLeadsToGoogleProjectin the left navigation and note that the project's artifacts open in the tooling interface as follows:
Open the sequence
salesforceToGmailandSpreadsheet.xmlunder synapse-config -> sequences.
Tip: See Working with sequences for information about sequences.
To change the information that you retreive from Salesforce about new leads, go to the Source tab and modify the salesforce query given below:
Tip: For more information about salesforce.query, see Querying records.
To change the default email template, go to the design view, click the Script mediator, and change the following script body.
By default, we have set the scheduled task to fetch new leads from Salesforce in every 120 seconds. This is done for testing purposes and in a real business environment, you might want to increase this value.
To change the time duration for the scheduled task, open
SalesforceToGoolgle.xmlthat is under synapse-config -> tasks and change the value of the Interval property.
Tip: If you change the task interval here, be sure to change the
salesforce_lead_intervalproperty with the same value in environment variables also.
Tip: For more information on scheduled tasks, see creating a scheduled task.
- Once you are done modifying the default scenario, right click GithubToSpreadsheetCAPP and click Export Composite Application Project. You will then be promped to save the project's artifacts as a CAR file.
You have now modified the default scenario.