Auto-register your attendees to mandatory sessions of the Event using a visual flow and process builder.
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.
Navigate to Setup> Flows > New Flow >Select Autolaunched Flow >Create.
- 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
- 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
- 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
- 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
- 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.
- 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
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'.
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.
- Create Records - This final step creates the Session Attendee records from the NewSessionAttendeeCollection variable.
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.
- Navigate to your Event and Click the Event URL
- Register an attendee
- Visit the Attendee record in Salesforce and see your registered session attendees!
Updated about 2 months ago