Use Cases

Auto-register your attendees to mandatory sessions of the Event using a visual flow and process builder.

Introduction

You can now automatically have session attendees created in Salesforce for all your attendees who have registered for the event with only clicks no code.

Setup steps

A. Create a flow

Navigate to Setup> Flows > New Flow >Select Autolaunched Flow >Create.

Flow Elements

  1. Get Attendee -This element will pass the Attendee record ID via process builder into the flow.
Object > Attendee
Condition Requirements
ID = AttendeeID (Text Variable)
How Many Records to Store: Only the first record
How to Store Record Data: Automatically store all fields
  1. Get Sessions - Get the Session records where Mandatory = True AND the Session record Event Id = the Event Id from the Attendee record.
Object >Session
Condition Requirements - Conditions are Met
Mandatory = True (Custom checkbox on session)
Event = Attendee.Event.id (Getting the related Attendee's Event ID)
How Many Records to Store: All records
Select Variable to Store Session Records > Mandatory Sessions (New Record Collection Variable)
Select Session Fields to Store in Variable > ID
  1. Get Session Attendee Records - Here we're getting all existing session attendee records to find one already exists for our Attendee.
Object >Session Attendee
Condition Requirements - Conditions are Met
Attendee = AttendeeID (Variable)
How Many Records to Store: All records
How to Store Record Data: Automatically store all fields
  1. Decision to check if mandatory session exists - Here we check to see if the Session collection variable from step 2 is empty. This prevents the flow from failing if the particular event has no Session records marked mandatory or has no Session records at all.
Outcome label - mandatory sessions exist 
When to Execute Outcome: All Conditions Are Met
Mandatory Session (Record collection variable) Is Null False
  1. Session Loop - This element takes individual records from our Session collection variable from step 2 and iterates over them to pull out the individual session IDs for further processing.
Specify Direction for Iterating Over Collection > First item to last item.
  1. Decision to check if there are existing Session Attendee record - here we check to see if any records were returned from our Get Session Attendee Records element from step 3.
Outcome label - session attendees exist?
When to Execute Outcome: All Conditions Are Met
Get Session Attendee Records (Record collection variable) Is Null False

If the outcome of the Decision from step 6 is Default Outcome, meaning there are no existing Session Attendee records at the beginning of this Flow interview, the flow will proceed to steps 7 and 8

  1. Assign Session Attendees - This assignment element takes the Session id from the loop variable along with the AttendeeId variable and assigns them to the appropriate fields within a record variable called NewSessionAttendee. It also sets Registration Status of the new Session Attendee records to 'Registered'.

  2. Assignment to Record Collection - This assignment element adds the current values of the NewSessionAttendee record variable from step 5 to a record collection variable called NewSessionAttendeeCollection. We will use this record collection variable in the last element to create all Session Attendee records all at once with a single element.

**Steps 7 and 8 repeats for each record in the collection from step 2.

Steps 9 and 10 are a nested loop within our primary Loop (step 5). The purpose of this nested loop is to first check any existing Session Attendee records to ensure we aren't creating any duplicate Session Attendee records in steps 7 through 9

9 and 10. Existing Session Attendee Loop & Decision - If there are any existing session attendees associated with the current Attendee and Session Id, this element will handle all records from the step 3 and no further processing will be required.

  1. Create Records - This final step creates the Session Attendee records from the NewSessionAttendeeCollection variable.

B. Activate Flow

C. Create a process builder.

New >Process Name>Create session attendees for mandatory sessions
Process starts when > A record changes
Choose object > Attendee
Define Criteria > Criteria Name > Check Registration status 
Conditions > Attendee = Registered (Status field)
Immediate Action >Flow
Set Flow Variable = AttendeeID = Attendee.Id.

D. Activate Process Builder

E. Test

  1. Navigate to your Event and Click the Event URL
  2. Register an attendee
  3. Visit the Attendee record in Salesforce and see your registered session attendees!

Did this page help you?