# Step

## Creating a step

A step is represented by a json object.  Steps can be loaded from one json file or multiple files. Recommended setup is to keep each step in a single file. This will simplify configuration and overview.

{% tabs %}
{% tab title="Properties" %}

<table><thead><tr><th width="165">Name</th><th>Description</th><th>Default</th><th data-type="checkbox">Mandatory</th></tr></thead><tbody><tr><td><pre><code>document_title
</code></pre></td><td>Text shown in browser tab. Overrides overlay. </td><td>Forms - Fortified ID</td><td>false</td></tr><tr><td><pre><code>order
</code></pre></td><td>Sort order of step. Omitting will result in undetermined execute order.</td><td>N/A</td><td>false</td></tr><tr><td><pre><code>time_lock
</code></pre></td><td>Used as a robot mitigator. How long before a step is allowed to be posted back to the server. Format conforms to <a href="https://en.wikipedia.org/wiki/ISO_8601">https://en.wikipedia.org/wiki/ISO_8601</a></td><td>0</td><td>false</td></tr><tr><td><pre><code>favicon
</code></pre></td><td>Favicon for this step. </td><td>Internal FortifiedID icon</td><td>false</td></tr><tr><td><pre><code>verbose_logs
</code></pre></td><td>Same as Flow but can override in a step</td><td>Empty array[]</td><td>false</td></tr><tr><td><pre><code>controls
</code></pre></td><td>List if controls for this step</td><td>N/A</td><td>true</td></tr><tr><td><pre><code>pipe
</code></pre></td><td>Pipe to be executed moving to next step.</td><td>N/A</td><td>false</td></tr><tr><td><pre><code>buttons.xxx
</code></pre></td><td>Same as for flow but can override in a step.</td><td>See Flow</td><td>false</td></tr></tbody></table>

{% endtab %}

{% tab title="Example 1" %}
Example step to create a user.

```json
{
    "controls": [
        {
            "id": "top_text_label",
            "type": "Markdown",
            "data": "# Create an Active Directory user \nEnter information about the user you want to create."
        },
        {
            "id": "givenName",
            "type": "Input",
            "ui": {
                "ui:size": {
                    "md": 6
                }
            },
            "schema": {
                "format": "strict"
            },
            "config": {
                "type": "string",
                "required": true
            }
        },
        {
            "id": "sn",
            "type": "Input",
            "ui": {
                "ui:size": {
                    "md": 6
                }
            },
            "schema": {
                "format": "strict"
            },
            "config": {
                "type": "string",
                "required": true
            }
        },
        {
            "id": "mail",
            "type": "Input",
            "ui": {
                "ui:size": {
                    "md": 6
                }
            },
            "schema": {
                "format": "email"
            },
            "config": {
                "type": "string",
                "required": true
            }
        },
        {
            "id": "mobile",
            "type": "Input",
            "ui": {
                "ui:size": {
                    "md": 6
                }
            },
            "schema": {
                "format": "phone"
            },
            "config": {
                "type": "string"
            }
        },
        {
            "id": "chooseRole",
            "type": "ValuePicker",
            "ui": {
                "ui:size": {
                    "md": 6
                }
            },
            "config": {
                "required": false,
                "options": [
                    {
                        "title": "Human Resources",
                        "value": "hr"
                    },
                    {
                        "title": "Sale",
                        "value": "sale"
                    },
                    {
                        "title": "IT",
                        "value": "it"
                    },
                    {
                        "title": "Engineering",
                        "value": "engineering"
                    }
                ]
            }
        },
        {
            "id": "adUserFindManager",
            "type": "ActiveDirectorySingleSelect",
            "ui": {
                "ui:size": {
                    "md": 6
                }
            },
            "config": {
                "attributes": [
                    "cn"
                ],
                "namespace": "${globals.ldap1_name}",
                "base_dn": "${globals.ldap1_flows_search_user_dn}",
                "scope": "SUB",
                "pre_filter": "(distinguishedName={{flow.manager}})",
                "filter": "(cn={{search_query}})",
                "value_key": "distinguishedName",
                "display_key": "cn"
            }
        }
    ]
}
```

{% endtab %}

{% tab title="Example 2" %}
Example step to edit and find users.

```json
{
    "controls": [
        {
            "id": "top_text_label",
            "type": "Markdown",
            "data": "# Change user\nSelect the user you want to modify"
        },
        {
            "id": "findActiveDirectoryUser",
            "type": "Selector",
            "config": {
                "columns": ["displayName","sAMAccountName","url","manager"],
                "pipe_id": "active_directory_edit_user_step01_widget"
            }
        }
    ],
    "pipe": "active_directory_edit_user_step01"
}
```

{% endtab %}

{% tab title="Example 3" %}
Example with all main properties.

```json
{
    "document_title": "flow00.step01.document_title",
    "favicon": "favicon.ico",
    "order": 1,
    "verbose_logs": [
        "flow",
        "session"
    ],
    "time_lock": "PT3S",
    "controls": [],
    "pipe": "forms.flow00.step01",
    "buttons": {
        "next_button": {
            "enabled": true,
            "text": "flow00.step01.next_button"
        },
        "save_button": {
            "enabled": true,
            "text": "flow00.step01.create_button"
        },
        "restart_button": {
            "enabled": true,
            "text": "flow00.step01.restart_button"
        }
    }
}
```

{% endtab %}
{% endtabs %}

### Pipe execution&#x20;

If configured, execution of a pipe is done with all data available to the step. This means data will vary depending on what step is executed.&#x20;

Data from all previous executed steps will be sent to pipe and accessed in pipes using *{{request.* pattern.

### Returning from pipe execution

In order to be able to access any data returned from a pipe, return a single item in a pipe.

Data will available using {{flow\.xxx}} pattern.

&#x20;&#x20;
