How do I default a lookup field from a text field in SharePoint list?

  • 12 November 2016
  • 9 replies
  • 30 views

Badge +3

So I have a SharePoint list with various text fields, a Nintex Form with list lookup fields (from multiple different lists on the form) who's text is connected to the text fields in the SharePoint list. For the first level of approval I need to carry the creator's choices for those drop downs to the task form of the approver so that the approver can update those if they need to.

Right now, the lookup fields default to no selection and I want them to default to what the SharePoint text field has. Is this possible somehow?


9 replies

Badge +10

You can import the main form to the task form and do the necessary changes. The controls will automatically display the data since it is already connected the fields. You can then manually add the approval button , decision and comment text.

save form and publish the workflow.

Badge +3

That's what I did but the task form is always displaying a null result. The only way I got this to work was to change the drop down to a text field and connect it to the SharePoint List. However I need the drop down so the person approving can easily change it without having to type in anything.

Userlevel 5
Badge +14

driving field for lookups is ID, not a text column.

to make lookups working reliably you have to connect lookup control to lookup field.

lookup control allows you to save text and/or ID of referenced item from 'the other' list to separate fields, but these have to be considered as auxiliary information since these can not ensure 'lookup' relationship. you can eg. freely change saved text to a value not existing in 'the other' list original text was taken from, or if you change the text value in 'the other' referenced (aka. lookup) list saved text value will not follow this change.

I'm not sure what you want to achieve and why you decided to store just text value.

but once you need master-detail reference between lists you have to set up lookup field in the list and respective lookup control in form(s).

Badge +3

I have it saved as text because the final approver needs the ability to copy and paste from the form in edit mode into our ERP system. Only way to do this is by storing it as a text field.

Badge +10

Hi Jacob,

I have the scenario working in both Nintex forms 2.9.0.0 and Nintex 2.9.3.0 , but my controls are in display mode not in auto mode.

But there is a work around , if you can place this controls in repeat section and connect the repeat section to a multi-line text field. Export the form and import it in task form. You will have the data in the task form and the approver can change it if he want. Just disable the option adding another row for the repeat section. The only problem is, you have to use a workflow to extract the value and fill the value to the corresponding fields because the controls in repeat section cant connect to a field.

Userlevel 5
Badge +14

if copying text is the only reason then I think you need not to save text to the list at all.

configure lookup field in the list and respective lookup control on the form. this will ensure selected lookup value is correctly stored in list and interpreted by all the new/edit/view/task forms.

add a calculated control value in addition to the form and set up its formula to something like

parseLookup(lkpControl,true)

this will parse text out of selected lookup value on the fly and will allow user to copy the text.

Badge +3

Each drop down is filtered by the 'Category' choice field hence why they are all in separate lists so that I can do that. I am not aware of how I can do filtered cascading drop downs any other way.

I need the ability to filter the drop downs based on the category drop down while being able to set the drop down choice in the task form for the approver to see and make modifications from.

Userlevel 5
Badge +14

I do not say that you should remove your cascading hierarchy at all. That's all fine.

I say not to save text value to the list but rather to create lookup field in list pointing to respective list (ie. Subcategories, Grades, Familes, etc) and connect lookup control on the form to that lookup field (on both new/edit and task forms). this will ensure that lookup control on task form will be automatically populated with value saved in list.

for the 'lookup text copy' purposes, place a calculated control on the form and set it up as I suggest above (one calculated value control for every lookup control you want to copy text from).

Badge +3

Thank you, not what I would have preferred to have done but it works. Sort of a three step workaround but it does the job.

Reply