Summary
Assign new or changed users on a learning path automatically, 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
- assigns new or changed contacts to a learning path in LearnUpon
This process is very similar to creating a course enrollment, 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 learning path assignment 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 Learning Path Enrollment in LearnUpon.
- In Apex Class Variables, the application adds 1 row automatically - LearnUpon portal (subdomain) to create enrollment in.
- Add 2 more rows with the learning path ID, and LearnUpon User ID to complete the setup.
- Save to finish.
The finished variables are:
- LearnUpon portal (subdomain) to create enrollment in > String > (your portal subdomain)
- Learning Path ID (either Learning Path ID or Learning Path Name must be specified) > Number > (learning path ID)
- LearnUpon User ID (LearnUponP__LU_User_ID__c) > Field Reference > [LearnUponP__LearnUpon_API_Call_Logs__c].LearnUponP__Response_ID__c.
The Response ID in Salesforce is equivalent to the User ID in LearnUpon. This ID links the two fields, for the Process Builder to find the ID of the user and enroll the user in the learning path in the specified LearnUpon portal.
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 learning path assignments in LearnUpon
To check if the process is creating assignments:
- From your portal's main navigation, go to Courses
- From secondary navigation select Learning Paths and select the applicable learning path.
- Select the Enrollments tab of the learning path, to see new users assigned to the path.
See: