Salesforce: Customizing Student Linking Logic in Salesforce Flow Builder

  • Updated

Customize student linking logic by using the Salesforce Flow Builder. In this article, we’ll include some examples, including how you can use Salesforce Flow Builder to:  

  1. Link students to existing Salesforce contacts while preventing ‘orphaned’ contacts from being created.
  2. Create a lead if a contact doesn't exist in Salesforce.
  3. Exclude internal users from the student linking logic based on the email domain.

Learn more about Setting up Student Linking Logic on Salesforce. 

Salesforce Flow Builder Overview

Salesforce Flow Builder (SFB) is a built-in iPaaS tool within Salesforce and allows you to automate workflows and internal tasks, such as sending emails, updating or creating a record, or sending a custom notification. It also provides a low-to-no code environment making it more suitable for non-technical users who may want to avoid using more complex Salesforce automation tools, such as APEX scripts. 

SFB’s most common triggers for flows are:

  • Screen flows.
  • Record-triggered flow.
  • Auto-launched flow (based on schedule).

In this article, we’ll include some example use cases focusing on record-triggered flows, but the other types of flows can be beneficial for you depending on the use case, such as using Skilljar course/path completion and live training attendance to kick off Salesforce workflows.

Link Students Only to Existing Contacts

You can set up a custom linking logic with Salesforce Flow Builder to link Skilljar students only to existing contacts without creating any new contact records on Salesforce. 

Note: These are the most up-to-date steps at the time of writing. Please check Salesforce and their help center for more information.

  1. Open your Skilljar dashboard and access the Salesforce settings page.
  2. Expand Authentication Settings and unselect the box by Link Contacts to disable the link.

    unnamed__18_.png

    • Note: This page requires Skilljar Dashboard admin access.
  3. Open Salesforce, search and select Flows on the setup page.

    unnamed__19_.png

  4. Create the new canvas and when asked, select the trigger for the flow. In this example, we want to trigger the flow based on a record (new student is created):

    unnamed__20_.png

  5. For the start configuration, select the following values:
    • Object: ‘Student (skilljar__Student__c)’
    • Configure Trigger: A record is created
    • Set Entry Conditions: None
      • Note: You can add filtering conditions to include/exclude students based on attribute-values here. For an example of filtering out users based on their email domain, such as internal employees, see Exclude Internal Users Based on Email Domain below.
    • Optimize the flow for Actions and Related Records.
    • Run Asynchronously-checkbox: Leave de-selected.

      unnamed__21_.png
  6. To add a new element that will get a list of all contacts, select the ‘+’-icon and then Get Records under the ‘Data’-section from the options menu.

    unnamed__22_.png

  7. Configure this step to point to the Contact-object:
    • Label: Get Contact List.
    • Description: This element will get a list of Contacts.
    • Object: ‘Contact’.

      unnamed__23_.png

  8. Select the object to open more options:
    • Filter: ‘Email’ equals {!$Record.skilljar__Email__c}.
    • Sort Contact Records: Descending by ‘LastModifiedDate’.
      • Note: the sorting condition will handle cases where multiple contacts exist with the same email Address. For this example, we’ll take the most recently updated contact and link the student to that record.
    • How Many Records to Store: Only the first record.
    • How to Store Record Data: Automatically store all fields.

      unnamed__24_.png

  9. Add a new object and select Decision. This is where we’ll check if a contact with that email address was found to determine the right action:
        • Outcome 1:
          • Label: Contact not found.
          • Condition requirement to Execute Outcome: All Conditions Are Met (AND).
          • Resource: ‘{!Get_contact_list}’ Is Null ‘True’.
        • Note: Refer to the previous step and check if no Contact was found, otherwise, move to the second outcome below.

          unnamed__33_.png

        • Outcome 2: 
          • Select Default Outcome
          • Label: Contact found

            unnamed__25_.png

  10. Define the action for each of the two conditions we created in the last step:
    • Contact not found: If no matching email between the student and contact is found, leave it as is.
    • Contact found: Select the ‘+’-icon to add a new element and under Data-Section, select Update Records.

      unnamed__26_.png

      • Label: Contact to Student.
      • How to Find Records to Update and Set Their Values: Use the student record that triggered the flow.
      • Set Filter Conditions: None.
      • Set Field Values for the Student Record:
        • Field: ‘skilljar__Contact__c’.
        • Value: ‘{!Get_contact_list.Id}’.

unnamed__27_.png

After completing the above steps, the finished flow should look like the image below:


unnamed__28_.png

You can debug and test the flow, and once it works as desired, activate it in your production environment.

Link Students to Existing Contacts: Create Leads if no Existing Contact Exists

You can also customize the flow to set up a different logic for what happens if a student doesn’t exist. In this second example, we’ll explain the logic for creating a lead in case no student exists with the same email address. 

Follow steps 1 to 10 in the Link Students Only to Existing Contacts section above. You’ll now need to add one additional step for the “contact not found” condition. To do this, you’ll create a lead for Student. 

  1. Add a new object and select Create Records.

    unnamed__29_.png

  2. In the Create Records menu, select the following:
    • Label: Create a Lead for Student.
    • How Many Records to Create: One.
    • How to Set the Record Fields: Use separate resources and literal values.
    • Object: Lead.
    • Field: Select the fields that you need to create a new Lead and map them to the field. values from the student record (for example, Lead Email → {!$Record.skilljar__Email__c}).

      unnamed__30_.png

  3. When you’re finished, select Done to complete. 

The flow would look as follows:


unnamed__31_.png

Exclude Internal Users from Linking Logic Based on Email-domain

You can use Flow Builder to exclude a group of students from the linking logic. One reason you may want to do this is to prevent internal/employee students from being linked to any Salesforce records. 

In this example, we’ll explain how to exclude students with the ‘@skilljar’ email domain from the linking logic. 

First, follow steps 1-4 in the Link Students Only to Existing Contacts section above.

    1. Select the following values:
      • Object: ‘Student (skilljar__Student__c)’.
      • Configure Trigger: A record is created.
      • Set Entry Conditions:
        • Condition Requirements: Custom Condition Logic is Met.
        • Condition Logic: NOT(1).
        • Field: ‘skilljar__Email__c’, Operator: Contains, Value: ‘@skilljar'.
      • Optimize the Flow for: Actions and Related Records.
      • Run Asynchronously-checkbox: Leave de-selected.

        unnamed__32_.png

    2. Follow steps 6 to 10 in the Link Students Only to Existing Contacts section above.
    3. When you’re finished, select Done to complete. 
    •  

Was this article helpful?

0 out of 0 found this helpful