Assign a data source workflow action in SXA

Current version: 10.1

You can implement any number of workflows. Workflow states can correspond to the stages that an item goes through before it is published on your website, such as creation, review, and approval. This gives you control over the content approval and publishing process.

SXA comes with a library of predefined components that pull data from data source items. This means that the rendered content is not bound to the page it appears on. Instead, the content is stored in the data source items.

To enable the versioning of data sources, you can add data source workflow actions to your page workflows. When a page moves through the workflow, your data sources follow in their own workflow. For example, when you move the page to the next workflow state, you might also want to change the state of the components and their data sources.

Note
  • If you are using SXA components, you must configure workflows for their data sources for each relevant site. You do this by defining standard values for your sites and assigning workflows to the Standard Values items of the components' data source templates.

  • Sitecore recommends that you do not configure a workflow on the globally defined standard values of data source templates located under the Templates node.

To assign a data source workflow action to an item in SXA:

  1. In the Content Editor, navigate to the workflow actions: sitecore/System/Workflows.

  2. Right-click the workflow action that you want to add the data source workflow action to, click Insert, and click Datasource Workflow Action.

    Add the Datasource Workflow Action to a workflow action.
  3. Enter a name, and click OK.

  4. Fill in the following fields:

    • Command item - commands move content items from one workflow state to another. When the command is executed, the item is moved to the workflow state that is defined in the command item. You can select any available command from the tree. For example, when a page is submitted, you want the data sources to move to the Update state.

      Screenshot that shows an example of a data source workflow.
    • Execute on items that pass this rule or any item if empty - to add a global condition for the data source workflow action, navigate to the Interactive section, and click Edit rule. For example, you might only apply the data source workflow action when the page is of a specific template. Or, for example, only apply the data source workflow action on Tuesdays.

    • Execute on data source items that pass this rule or all data sources if empty - to add a condition for the data source workflow action, navigate to the Interactive section, and click Edit rule. For example, only apply the workflow action for data sources of a specific component.

    When you submit the page to the next workflow state, depending on your settings, the data source workflow state is updated as well. For example, if you use the sample workflow for your pages and added a data source workflow action to the Submit state, the data source workflow state changes accordingly.

    If you add the data source workflow action (Update) to the page workflow command (Submit) and submit the page, the state of the data source item changes from Initial to Update.

Using data source workflows with page and partial designs

If you are using page designs and partial designs, the data source item of a component is only moved through its workflow if the following conditions are met:

  • The component uses a data source that is relative to the page. When specifying the path in the component properties in the Experience Editor, use this syntax: page:/, for example page:/Data/Text1.

    The component properties in the Experience Editor
  • The data source is located directly under the page.

Do you have some feedback for us?

If you have suggestions for improving this article,