Creating a Step Definition
Step definitions let you create reusable steps. They can be quite simple or very complex, depending on your requirements. Several elements, called types, can be added to a step definition to provide flexibility.
Step Option Fields
When creating an option, you can configure several fields that control different aspects of the step definition.
Name
Display name
Description
Required
Type
Default Value
Add validation
Hidden
Name
This is the option's name. It is important because DeployR creates a task sequence variable based on this value. For example, if you name the field textbox, the task sequence will contain a variable named textbox. Its value will be whatever the administrator enters in the task sequence editor when adding this step definition.
Display name
This is the friendly name displayed in the task sequence editor. It helps the administrator understand what to enter or select in the value field.
Description
This text appears in a tooltip and provides additional instructions for the administrator using the step.
Required
Tells the task sequence editor whether the administrator must provide a value for this option. This is helpful when requiring an admin to choose from a drop-down list or to add specific information for your task sequence to run correctly.
Type
Choose the type of input to collect from the admin. Additional settings for the chosen type appear in the lower section.
Default Value
This is helpful when a variable is usually set to a specific value. This allows the step definition to be preset to a value, which is based on the type chosen earlier. This field is required when using the script type.
Add validation
When using text fields, you can add regex rules to ensure the admin puts in data that will not break the process later. For example, if collecting a URL from the admin, a regex rule can check for http or https in the text string.
Hidden
This property tells the task sequence editor if this option will be visible for the admin to see. Often, when a script runs behind the scenes, the script option is hidden, which keeps the UI clean for the admin.
Available Types
Text
Large Text
Number
Boolean
Script
Content
Content List
Drop Down
Task sequence
Text
When information is required from the end user, a text type can be used. The text will be returned to the step as a STRING and can be used in tandem with the script type which could consume that information.
Large Text
Similar to Text but allows for a larger block to be added.
Number
Allows a number to be entered.
Boolean
Creates a check box. If checked, it returns true; if unchecked, it returns false.
Script
There are two ways in which you can use the script type. When you click "Add option", the "Add step option" dialog appears:
For embedding a script, set the NAME property to script, then paste in your script as the default value
For running a script from a content item, set the NAME property to scriptName, and set the name of the script in your content item as the default value
make sure that your script is associated with a content item. The step logic will automatically look for a script with the name you set in the default value in a content item labeled "content"
Content
Provides files to your step definitions; most commonly used for scripts, JSON files, etc.
Content List
Drop Down
Allows the creation of items and values, helping to prevent user error when setting up the step.
Task sequence
Calls a task sequence from the step definition.
Step Definition in the UI
This is not a real step definition and would not work. It is just an example to show all of the options and what they look like in the UI. Real samples are in the subpages.
As shown under Step Definitions:

As shown in a task sequence that it was added to:

Pro tip: look at some of the built-in step definitions to see how they work. If they include scripts and content items, you can look into those as well.
The subpages have some production examples of how step definitions can be created and used.
Last updated

