FLOs begin with an Event. Often that event will be tied to an application (e.g. new records in Salesforce). This topic covers two alernatives: A Schedule event or a Child FLO event.
A “Child FLO” event is used for a FLO that runs when called by another FLO.
This is useful when:
- You have a series of steps that get used more than once in a single FLO or across multiple FLOs. Moving them into their own “child FLO” lets you create them once and then reuse them repeatedly. You run the steps from other FLOs by using Call FLO or Call FLO Async.
- You want to process a list, one item at a time. For instance, you can run a series of steps on each list item using For Each or you can transform a list into a new list (one item at a time) using Map.
- Or, if you just want to break a very large FLO into smaller, more manageable parts.
Each Child FLO card has the following outputs:
- Inputs to this FLO
- Click to create custom fields, one at a time. Give each a name and data type (such as Text or Number). Each custom field you create corresponds to an expected input from any FLO that calls your child FLO.
- Context - the outputs in this section are automatically assigned values every time the FLO runs:
- Index - This number output is assigned a value when the FLO is called from a function that loops through the items of a list (e.g. a For Each or Map function). The value of _Index_ corresponds to the item’s position in the list (starting with zero) processed by this particular instance of the FLO.
- Caller - The keys of the Caller object tell you which FLO called the child FLO (id and name), which particular execution of the FLO made the call (_executionid), and which particular step in the FLO (method, which is an unique ID). When the child FLO is manually run, then id and _executionid are null. This is especially useful for debugging purposes.
- Error - This object output is assigned a value when the FLO is called for Error Handling. The value of Error corresponds to the raw error object returns by the application or action that caused the error – e.g. an object that will often have keys that include “message”, “statusCode” and “execution” (the unique identifier of the FLO execution that caused the error, which can be used to construct a URL to the execution history that shows the FLO details that led to the error).
- Execution ID - the unique ID of the FLO instance.
Note: A Child FLO must be turned on before it can be called by other FLOs.
A “Scheduled FLO” event is used for a FLO that runs according to a schedule, such as once an hour, 5pm on Fridays, or at 9am on the first day of every month.
Adding a Scheduled FLO event prompts you to provide the schedule details. You can change the schedule by clicking the clock icon at the bottom of the card. (Note: You can similarly adjust the schedule of most application events. For instance, you can set a Salesforce - New Record event to check for new records every Friday at 5pm rather than every 5 minutes.)
The schedule goes into effect only after the FLO has been turned on.
Each Scheduled FLO card has the following outputs:
- Current Time - the date and time that the current instance of the FLO was initiated (in ISO UTC format). This can be passed to any text or date & time input.
- Execution ID - the unique ID of the FLO instance.
Starts a FLO whenever a custom web form is submitted. (Available as an Event choice if included in your plan.) The form is automatically generated using the fields that are added to the card.
Step 1: Create a field for each input you want on the form
Each custom field that you create on the card will result in an input field added to your custom form. They look like output fields on the card (that can be used to map values to later steps in your FLO). But, after step 2, you’ll be able to preview the actual form or access it via a web page.
For each field, use the type dropdown to configure the form inputs:
- Text - appears as a text input box on the form
- Number - like a text input box, but only accepts valid numbers
- Date - appears as a date picker control on the form
- True/False - appears as a checkbox on the form
- File - appears as a file picker on the form, with a “Choose File” button
- Customize… - gives access to changing the display name as well as optional default value and optional help text. The display name shows up as the form control label (e.g. the text of the checkbox). Optional help text appears as a non-bold subtitle beneath the label.
Step 2: Save and Turn On the FLO
Once you’ve saved and turned on the FLO, you’ll be able to preview your form by clicking the “form” link at the top of the card or the “Form Settings” button on the bottom. You’ll be give a URL that leads to the form or the iframe snippet to embed the form in an existing web page.
Step 3: Build the rest of your FLO
The FLO will run each time someone clicks the “Submit” button on the form and will pass all of the input values. Drag and drop your form fields to later steps in the FLO to run actions or functions on those values.
Use a Return card at the end of your FLO to display one or more values to the form user when the FLO completes, e.g., show a custom message and/or calculated results.
In addition to the form fields, all Form cards have one additional output field, called “Execution ID,” that does not appear on the form. It’s assigned a unique value every time a new form is submitted.