Run a Flow when creating a new Reservation

GoMeddo allows you to run a flow when the user makes a time selection on the calendar, before the reservation form is opened.

A simple use case for this is to pre-populate fields dynamically, which is the example we will follow in this article, but keep in mind that flows are very powerful and allow you to do a lot more.

The execution of the configured flow is before the execution of the custom Init Handlers.

Create the Flow

One requirement for the flow to work is that it has a record variable of named ‘reservation’, which is available for both input and output. Conveniently, GoMeddo includes a template flow with such a variable, that can be cloned and adapted to your needs.

  1. In Setup, go to the Flows section and find the flow named 'Default Reservation Flow Template'.

     

  2. Click on the flow in order to edit it. Notice that it has a start element and an assignment element.

  3. Delete the assignment and create your own. For our example we will simply set the title of the reservation to the Resource name. For your own version, you can do something entirely different, and include more steps if you want to.

     

  4. Don’t forget to connect the start element to your new assignment, by drawing a line to it.

  5. In the top right, click Save As and give the flow a label and a name. Note the API name, as you will need this in the next section.

     

  6. Finally, click Activate. If this gives you any warnings or errors, resolve them and save/activate again.

Configure the Flow to run

Now it’s time to let GoMeddo know to run the flow.

  1. Go to the Details section of the Settings tab, and enter the flow’s API name under ‘Reservation Form Initialization Flow Api Name’.

  2. Go to the Resource calendar, and create a new reservation. Notice that the flow has executed. In our example, the Title field should have been populated with the Resource name.

     

Warning

Even if the flow is deactivated, it will still run if you add it to the custom setting as described in step 1. This is referenced in the Salesforce documentation:

When a flow user invokes an autolaunched flow, the active flow version runs. If there’s no active version, the latest version runs. When a flow admin invokes a flow, the latest version always runs.