Using parseLookup() on Form Control Values

  • 15 February 2022
  • 0 replies
  • 416 views

Userlevel 3
Badge +8

Topic

Note: This article applies only to Nintex for SharePoint and Nintex Forms for Office 365. The examples and functions described below work similarly in both platforms.

 

Form controls such as List Lookup and People Picker display results on the form in an easy to read format, but their true value that is stored is a combination of an ID and the text value in the format of ID;#Text. For example:

 

List Lookup control, selects an item titled ‘Seattle’ with an item ID of 5

Value as displayed on the form: Seattle

Stored value: 5;#Seattle

 

People Picker (New Responsive Form) control, user selects John Doe who’s Account Name is john.doe@nintex.com

Displayed value: John Doe

Stored value: i:0#.f|membership|john.doe@nintex.com;#John Doe

 

Referencing the control’s value elsewhere, such as in Calculated Value control, Label control, runtime functions, and form variables, may behave or display unexpectedly as they will be using the stored value. This necessitates the use of the runtime function parseLookup().

 

Instructions

 

Note: parseLookup() is available under ‘Runtime Functions’ (Classic, Responsive Forms) or ‘Functions’ (New Responsive Forms) when building formulas in areas such as Form Rules, Form Variables, or Calculated Value (Classic, Responsive only) controls.

 

1. Select the parseLookup() function.

2. Add the Lookup value parameter. For example, parseLookup(MyLookupControl)

3. Optionally, add the return text boolean parameter. If this parameter is excluded, the default value is true. For example, parseLookup(MyLookupControl, true)

 

Examples of outputs using the List Lookup control example from above:

parseLookup(MyLookupControl) → Seattle

parseLookup(MyLookupControl, true) → Seattle

parseLookup(MyLookupControl, false) → 5

 

Examples of outputs using the People Picker (New Responsive forms) control from above:

parseLookup(MyPeoplePicker) → John Doe

parseLookup(MyPeoplePicker, true) → John Doe

parseLookup(MyPeoplePicker, false) → i:0#.f|membership|john.doe@nintex.com

 

 

Related Links

Runtime Functions in Nintex for SharePoint: https://help.nintex.com/en-US/nintex2019/current/sp2019/Forms/Designer/RuntimeFunctions.htm

Runtime Functions in Nintex Forms for Office 365 (full list on left-hand side): https://help.nintex.com/en-US/office365/Designer/FormulaBuilderFunctions.htm

 


0 replies

Be the first to reply!

Reply