Working with the ContextDataLookup control
The ContextDataLookup user control can retrieve a value from a variety of contextual sources, including literal values, workflow variables, SharePoint list item properties, workflow context values, user profile properties, and workflow constants.
Registering the control
The following Register directive registers the ContextDataLookup user control for use on a configuration page.
<%@ Register TagPrefix="Nintex" TagName="ContextDataLookup" Src="~/_layouts/15/NINTEXWORKFLOW/ContextDataLookup.ascx" %>
Declaring the control
The following example illustrates how to add a ContextDataLookup user control to a configuration property.
<Nintex:ContextDataLookup runat="server" id="lookupControl" />
Implementing the control
The appearance of the ContextDataLookup user control varies depending on the selected value in the field chooser dropdown, as described in the following list:
-
Literal values
If the field chooser dropdown is set to Value, the control allows a literal value to be entered, or the Insert Reference button can be clicked to build the value dynamically at run time.
-
Workflow variables
If the field chooser dropdown is set to Workflow Data, the control allows a workflow variable to be referenced. Clicking the ellipsis button displays a dialog with which the user can specify a return type for the workflow variable.
-
SharePoint list item properties
If the field chooser dropdown is set to List Lookup, the control allows any property from either the current item or an item within a SharePoint list or document library in the current SharePoint site. If the Source dropdown is set to Current item, the control resembles the following diagram:
If the Source dropdown is set to a SharePoint list or document library in the current SharePoint site, the control resembles the following diagram:
-
Workflow context values
If the field chooser dropdown is set to Workflow Context, the control allows a value associated with the current workflow to be set and used within the workflow action.
-
User profile properties
If the field chooser dropdown is set to User Profiles, the control allows a reference to be made to a user profile property for the specified account name.
-
Workflow constants
If the field chooser dropdown is set to Workflow Constants, the control allows a workflow constant that has been set for the SharePoint farm, site collection, or site to be used within the workflow action.
The appearance of the control can be adjusted in the following ways:
-
The CSS style attributes applied to the background color style for the row containing the field chooser dropdown can be specified in the DisplayFieldChooser property.
-
The CSS style attributes used to style the <div> element that contains the control can be specified in the Style property.
-
The CSS style class used to style the input controls can be specified in the ControlClass property.
-
The CSS style attributes used to style the input controls can be specified in the ControlStyle property.
-
Set the HideInsertReference property to true to hide the Insert Reference button where applicable.
Applies to literal values, SharePoint list item properties, and user profile properties.
-
Set the ControlType property to the data type used when the control returns a value.
Applies to workflow variables.
-
Set the DateOnly property to true, to indicate that the date and time picker control should only display the date picker, without the time component.
Applies to SharePoint list item properties and user profile properties.
-
Set the IncludeSPItemKeyVars property to true to include list item ID workflow variables in the workflow variable dropdown.
Applies to workflow variables.
-
Set the ValidateInput property to a JavaScript string used to validate the value of the numeric input control. The JavaScript string is evaluated on the onBlur event of the numeric input control.
Applies to literal values.
-
Set the ChoiceOnChange property to a JavaScript string used to validate the value of the choice or Boolean dropdown control. The JavaScript string is evaluated on the onBlur event of the choice or Boolean dropdown control.
Applies to literal values.
-
Set the ShowCurrentDateOption property to true to display the Use date when action is executed option.
-
Set the ShowRemoveValuedOption property to true to display the Remove value option.
-
Set the ShowRuntimeTimeOption property to true to display the Include time option, if ShowCurrentDateOption is set to true.
-
The following properties can be set to configure the corresponding properties on the SharePoint 2013 PeopleEditor control:
-
SingleLine
Applies to user profile properties.
See Also
Concepts
Operations
Working with configuration pages