Working with the VariableSelector control
The VariableSelector server control can retrieve a value from a workflow variable. The control can be set to present only specific types of workflow variables, and it can allow hard-coded options to be included in the list by a JavaScript function.
Registering the control
The following Register directive registers all server controls, including the VariableSelector control, for use on a configuration page.
<%@ Register TagPrefix="Nintex" Namespace="Nintex.Workflow.ServerControls" Assembly="Nintex.Workflow.ServerControls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=913f6bae0ca5ae12" %>
Declaring the control
The following example illustrates how to add a VariableSelector server control to a configuration property.
<Nintex:VariableSelector ID="drpFields" Width="200px" runat="server" IncludeSPItemKeyVars="True" IncludeBlankOption="False" IncludeTextVars="True" IncludeNumberVars="True" IncludeIntegerVars="True" IncludeBooleanVars="True" IncludeDateTimeVars="True" IncludeLongVars="True" IncludeArrayListVars="False">
Implementing the control
Internally, the VariableSelector server control is derived from the InputDropDownList server control, and appears as a dropdown list on the configuration page, as shown in the following example.
The appearance of the control can be adjusted in the following ways:
-
Set the AddNonBlankDefaultValuesFunction property to the name of a JavaScript function that is invoked when the list is refreshed, to allow hard-coded options to be added in addition to the list of available workflow variables.
-
Set the IncludeArrayListVars property to true to include Collection workflow variables.
-
Set the IncludeBlankOption property to true to include a blank initial option. By default, this option is excluded.
-
Set the IncludeBooleanVars property to true to include Yes/No workflow variables.
-
Set the IncludeDateTimeVars property to true to include Date and Time workflow variables.
-
Set the IncludeInitialisersInSort property to true to indicate that, if AddNonBlankDefaultValuesFunction is set to a JavaScript function, any hard-coded options added by that JavaScript function are included when the options are sorted alphabetically. By default, hard-coded options are excluded when the options are sorted.
-
Set the IncludeIntegerVars property to true to include Integer workflow variables.
-
Set the IncludeLongVars property to true to include Action ID workflow variables.
-
Set the IncludeNumberVars property to true to include Number workflow variables.
-
Set the IncludeSPItemKeyVars property to true to include List Item ID workflow variables.
-
Set the IncludeTextVars property to true to include Single line of text, Multiple lines of text, and Person or group workflow variables.
-
Set the IncludeUserVars property to true to include Person or group workflow variables.
-
Set the RenderForPrimitiveValue property to true to indicate that the workflow variable is returned as a workflow reference string, using the following format, where <VariableName> is the name of the workflow variable:
{WorkflowVariable:<VariableName>}
See Also
Concepts
Operations
Working with configuration pages