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.
In Setup, go to the Flows section and find the flow named 'Default Reservation Flow Template'.
Click on the flow in order to edit it. Notice that it has a start element and an assignment element.
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.
Don’t forget to connect the start element to your new assignment, by drawing a line to it.
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.
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.
Go to the Details section of the Settings tab, and enter the flow’s API name under ‘Reservation Form Initialization Flow Api Name’.
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.
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.