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. Make sure Start from Scratch is selected, and click Next.
  5. Select Record-Triggered Flow and click Create.
  6. For Object, enter Event Registration and select Event Registration.
  7. Select A record is created or updated.
  8. Ensure None is selected for the Condition Requirements.
  9. 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. For API Name, enter sessionRegistrationName.
  5. For Data Type, select Text.
  6. In the Formula text box, enter: {!$Record.Attendee__r.FirstName} & " " & {!$Record.Attendee__r.LastName} & " - Dreamforce 2023"
  7. Click Check Syntax.
  8. Click Done.
  9. Click Flow Builder Toolbox button to close the Flow Builder Toolbox.

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, 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)
    • Resource: Triggering Event_Registration__c > Event Name > Public Event Name
Note

Search triggering and click the arrow next Triggering Event_Registration__c under Global Variables, then click the arrow next to Event Names under Relationship Fields, and finally select Public Event Name under Record Fields.

    • 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 Close to close the Decision element panel.

Create Elements for the Yes Outcome

  1. Under the Yes element, click Add Element.
  2. Search and select Get Records.
  3. For the Label, enter Get Dreamfest Session.
  4. Ensure the API Name is Get_Dreamfest_Session.
  5. In the Get Records of This Object section, for Object, select Session.
  6. For Condition Requirements, select All Conditions Are Met (AND) and enter the following information:
    • Field: Name
    • Operator: Equals
    • Value: Dreamfest 2023
  7. For Sort Order, select Not Sorted.
  8. For How Many Records to Store, select Only the first record.
  9. For How to Store Record Data, select Automatically store all fields.

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

  1. On the Yes path after the Get Dreamfest Session element, click Add Element.
  2. Search and select Create Records.
  3. Enter the following details:
    • Label: Create Session Registration
    • API Name: Create_Session_Registration
    • How to Set the Record Fields: Manually
    • Object: 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: Attendee
    • Value 1: Triggering Event_Registration__c > Attendee (the one with a > at the end of the line) > Contact ID
    • Field 2: Session Registration Name
    • Value 2: sessionRegistrationName
    • Field 3: Public Event Name
    • Value 3: Triggering Event_Registration__c > Event Name (the one without a > at the end of the line)
    • Field 4: Session Name
    • Value 4: Session from Get Dreamfest Session > Record 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

Comparta sus comentarios sobre Trailhead en la Ayuda de Salesforce.

Nos encantaría conocer su experiencia con Trailhead. Ahora puede acceder al nuevo formulario de comentarios cuando quiera desde el sitio de la Ayuda de Salesforce.

Más información Continuar para compartir comentarios