Skip to main content

Add Automation to Your App

Automate Dreamfest Record Creation

Now that the registration process is in place, you can go even further! Every time an attendee registers for Dreamforce, they should also be registered automatically for the Dreamfest session. To automate this, you use a tool called Flow Builder.

Flow This Way

Let’s use Flow Builder to create an automation that adds the Dreamfest session for every attendee for the Dreamforce event. 

  1. Click setup gear and select Setup.
  2. enter Flows in the Quick Find box and select Flows.
  3. Click New Flow.
  4. Select Record-Triggered Flow and click Create.
  5. For Object, enter Event Registration and select Event Registration.
  6. Select A record is created or updated.
  7. Ensure None is selected for the Condition Requirements.
  8. Ensure Actions and Related Records is selected.

Add a New Resource

Create a resource, in this case a formula, that you will reference later in this unit.

  1. Click Flow Builder Toolbox button to open the Flow Builder Toolbox.
  2. Click New Resource.
  3. For Resource Type, select Formula.
  4. Enter sessionRegistrationName for the API Name.
  5. For Data Type, select Text.
  6. Add {!$Record.Attendee__r.FirstName} & " " & {!$Record.Attendee__r.LastName} & " - Dreamforce 2023" to the Formula text box.
  7. Click Check Syntax.
  8. Click Done.

Add a Decision Element

Now add the action you want to happen when your conditions are met. In this case, you want to add a decision element.

  1. On the path after the Start element, hover over Add Element and click Add Element.
  2. Search and select Decision.
  3. Enter the following details:
    • Label: Is the Event DF23?
    • Ensure API Name is Is_the_Event_DF23

Two paths will be created from this decision element. The yes outcome and the no outcome. First, create the yes parameters.

  1. With the New Outcome option selected in the Outcome Order, enter the following information:
    • Label: Yes
    • Outcome API Name: Yes
    • Condition Requirements to Execute Outcome: All Conditions Are Met (AND)
    • For Resource, select $Record > Event_Name__r > Name
    • Operator: Equals
    • Value: Dreamforce 2023
    • When to Execute Outcome: Only if the record that triggered the flow to run is updated to meet the condition requirements
  1. Click Default Outcome in the Outcome Order.
  2. Remove the current label text and enter No for the Label.
  3. Click Done.

Create Elements for the Yes Outcome

  1. Under the Yes element, hover over Add Element and click Add Element.
  2. Search and select Get Records.
  3. Enter Get Dreamfest Session as the Label.
  4. Ensure the API Name is Get_Dreamfest_Session.
  5. In the Get Records of This Object section, select session for Object.
  6. For Condition Requirements, select All Conditions Are Met (AND) and enter the following information:

Field

Name

Operator

Equals

Value

Dreamfest 2023
  1. Select Not Sorted for Sort Order.
  2. Select Only the first record for How Many Records to Store.
  3. Select Automatically store all fields for How to Store Record Data.

Now that the records have been pulled, time to do something with this information by creating a new record for session registration.

  1. Under the Get Dreamfest Session element, hover over  Add Element and click Add Element.
  2. Search and select Create Records.
  3. Enter the following details:
    • Label: Create Session Registration
    • API Name: Create_Session_Registration
    • How Many Records to Create: One
    • How to Set the Record Fields: Use separate resources, and literal values
    • For object, select Session Registration
  1. In the Set Field Values for the Session Registration section, click +Add Field three times.
  2. Enter the following details:
    • Field 1: select Attendee__c a
    • Value 1: select $Record > Attendee__r > Id
    • Field 2: select Name
    • Value 2: select sessionRegistrationName
    • Field 3: select Public_Events__c
    • Value 3: select $Record > Event_Name__c
    • Field 4: select Session_Name__c
    • Value 4: select Session from Get_Dreamfest_Session > Id

Save and Activate the Flow

  1. Click Save in the upper right.
  2. Label your new Flow as Dreamforce Event Registration.
  3. Ensure the Flow API Name is Dreamforce_Event_Registration.
  4. Click Save.
  5. Click Activate.
  6. Click back arrow button in the upper left.

Try It Out

Next, create a sample record and see how it all works together.

  1. Click app launcher  to open App Launcher.
  2. Under All Items, select Event Registrations.
  3. Click New.
  4. Give the registration any name.
  5. For Attendee, create a new contact with your name and click Save.
  6. For Event Name, select Dreamforce 2023.
  7. Click Save.

Now click the Session Registrations tab, and see the record that was automatically created for Dreamfest 2023.

You Did It!

Congratulations! You installed a managed package, and then you extended that package by adding a custom object, custom fields, and automation, and you added sample data along the way. Well done!

Resources

Keep learning for
free!
Sign up for an account to continue.
What’s in it for you?
  • Get personalized recommendations for your career goals
  • Practice your skills with hands-on challenges and quizzes
  • Track and share your progress with employers
  • Connect to mentorship and career opportunities