Summary
Use Salesforce's Process Builder to automatically create a course enrollment in LearnUpon, whenever you create or edit a Contact record in Salesforce.
The Salesforce integration is available depending on your LearnUpon plan.
The Salesforce Process Builder allows you to create an automated process with Salesforce records, without writing any code. In this worked example, Process Builder:
- checks for created or edited contacts on Salesforce, which appear in the LearnUpon API Call Logs
- enrolls new or changed contacts to a course in LearnUpon
This process is very similar to creating a learning path assignment, with the same object and criteria. The action required to complete the process is different.
When the process is complete, select Activate to apply it to your Salesforce data.
Prerequisites
To use Salesforce's Process Builder:
- install the LearnUpon app in your Salesforce organization - see Salesforce: set up LearnUpon and add a tab for all users
- add the LearnUpon API connection to Salesforce - see Salesforce Process Builder: Making automated calls to LearnUpon
Create a course enrollment in LearnUpon
Create a Process in Process Builder
Create a process, give it a name and API name, and define the process type.
- From Salesforce Home select Setup.
- Use Search to access Process Builder.
The following screenshot shows Setup in Salesforce.
- From the Process Builder, select New, to open a new process.
- Enter a Process Name and Api Name. Optionally, add a description.
- From The process starts when, select one of:
- A record changes (used in this sample process)
- A platform event message is received
- It's invoked by another process
- Save this part of the process.
Select the Object and process trigger, and define the criteria
To find changes which originate in Salesforce you use the LearnUpon API Call Logs object. The criteria are a 200 status code, and a users Call Type in the call logs. The conditions are AND, requiring the data to meet both conditions.
- In the process builder, select Add Object.
- In Object, search for the LearnUpon API Call Logs as Object.
- For Start the process, choose what event makes the process start. Select one of:
- when a record is created
- when a record is created or edited
- Save to finish this section.
The following screenshot shows Choose Object and Specify When to Start the Process, with LearnUpon API Call Logs as the Object.
- In the process builder, select Add Criteria and define the condition which triggers the action, one of:
- Conditions are met, used in this example
- Formula evaluates to true
- No criteria - just execute the actions
- In Set Conditions, add the following criteria for the conditions:
- First row: select [LearnUponP__LearnUpon_API_Call_Logs__c].LearnUponP__Status_Code__c > Equals > Number > 200.
- 2nd row: select [LearnUponP__LearnUpon_API_Call_Logs__c].LearnUponP__Call_Type__c > Equals > String > users.
- For Conditions, select All of the conditions are met (AND).
- Save to finish this section.
The following screenshot shows Define Criteria for this Action Group, with these conditions.
Set the process action, aka what happens when data meets all the criteria
- In the process builder, select Add action to define the action that happens when the criteria are met.
- From Action Type, select Apex and enter a name for the action.
- In Apex Class, select Create Enrollment in LearnUpon.
- In Apex Class Variables, the application adds 2 rows automatically - Email and LearnUpon portal (subdomain) to create enrollment in.
- Add 1 more row with the course ID or the course name, to complete the setup.
- Save to finish.
The finished variables are:
- Email > String > [LearnUponP__LearnUpon_API_Call_Logs__c].LearnUponP__Contact__r.Email
- LearnUpon portal (subdomain) to create enrollment in > String > (portal subdomain)
- Course ID (either Course ID or Course Name must be specified) > Number > (course ID)
The following screenshot shows Add Action and decision tree.
When the process is complete, select Activate to apply it to your Salesforce data.
To view the process from the start, return to Salesforce Home, and access Process Builder from the beginning.
Confirm enrollments in LearnUpon
To check if the process is creating enrollments:
- From your portal's main navigation, go to Courses > your course name.
- From secondary navigation select Enrollments, to see new users enrolled on the course.
See: