Creating Flows
With flows, you can extend an existing resource or create a new resource for your store or organization. You can also use to create simple custom fields for existing resources or complex collections of fields and data. You can create useful resources for your customers, such as a want list, or blogs for your store or organization.
For more information about using flows in Commerce, see Custom Data (Flows).
Do not create flows in Extensions > Flows. Use Merchandise > Products > Templates page to create a Product Experience Manager flow. However, all flows in the store are displayed in the Extensions > Flows page where the template flows are labelled with a prefix PCM. We recommend not to update template flows in this page.
Creating Flows
-
Go to Extensions > Flows.
All flows available in the store are displayed, if any.
-
Click New flow.
The New flow sheet is displayed.
-
In the Name field, enter a name for the flow.
-
In the Slug field, enter a slug.
By default, the name is used as the slug.
-
In the Description field, enter a description for the flow.
-
To enable the flow, select Enabled.
-
Click Save.
The new flow is added to the list of flows available in the store. All flows are displayed under Extensions > Flows from the menu.
- Core flows will be labelled as
CORE. Refer to Flows in Commerce for more details.
Adding fields to a flow
-
Go to Extensions > Flows.
-
In the flow's row, click Configure flow. You can also click the flow name and select Configure flow.
The flow configuration page shows the flow's fields.
-
Click New field and select the field type:
- Boolean
- Float
- Integer
- String
- Date
- Relationship A relationship type specifies the relationship between the flow and a Composable Commerce resource, such as products. You can have several relationships in a flow.
A sheet for the new field opens.
-
Under Field configuration, enter the following:
- Name: Specifies the name of the field.
- Slug: Specifies a unique slug identifier for the field.
- Description: Specifies a description for this field.
- Order: Specifies the order in which this field is returned relative to the rest of the flow fields. Use a number.
- Default value: Specifies a default value for the field if no value is provided and the field is required.
-
Under Validation settings, set the following:
- Required: Specifies whether the field is required. Leave this off if the field type is Relationship.
- Enabled: Specifies whether the field is enabled.
Then set the validation options for the field type:
Field type Validation description Boolean No validation required. Float Enter a Minimum and Maximum. Optionally, add Allowed values. Integer Enter a whole-number Minimum and Maximum. Optionally, add Allowed values. String Select a Format (None, Email, Slug, or UUID), or enter Allowed values. Date Optionally, enter Allowed dates in the YYYY-MM-DD HH:mm:ss format. The time is optional. Relationship Select the Relationship type (One to one or One to many), and select the Resource. The Resource can be one of Products, Brands, Collections, Categories, Customers, Orders, or Promotions resources. -
Click Save.
To edit a field, click it in the fields table on the flow configuration page. To delete a field, open it, click ⋮, select Delete, and then click Delete field to confirm.
Adding values to fields
-
Go to Extensions > Flows.
-
In the flow's row, click See entries. You can also click the flow name and select See entries, or select the flow under Flows in the Extensions menu. The menu lists 10 flows at a time. If the flow isn't listed, click See more to show the next 10.
The entries page lists the flow's entries. To go to the flow's fields from here, click Configure flow.
A flow needs at least one field before you can create entries.
-
Click New entry, enter values for the fields as required, and save the entry.
To add relationships to an entry, save the entry first.
You can also delete entries from the entries table. When prompted, click Delete entry to confirm.
You cannot add attributes for template flows in this page. Use the Product Experience Manager > Configurations > Attributes page to add attributes in a Product Experience Manager template.
Updating Flow Settings
- Go to Extensions > Flows.
- In the flow's row, click Configure flow.
- Click ⋮ and select Settings.
- In the Flow settings sheet, update the settings as required.
- Click Save.
Deleting Flows
- Go to Extensions > Flows.
- In the flow's row, click Configure flow.
- Click ⋮ and select Delete.
- Click Delete flow to confirm.
Core flows can't be deleted. For a core flow, Delete is disabled.
If your role can view flows but not manage them, you see View flow instead of Configure flow, and flows, fields, and entries open read-only.
Sorting and Filtering Flows
You can sort the flow list by Name, Slug, Description or Status.
You can filter the list to show only Enabled or Disabled flows.