cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Form: Setting Value on Lookup field that allows Multiple values

Can anyone point me to Documentation or how to set a lookup field with allow multiples?

I'm using a query string ?cases=34

34 is the ID of the lookup item i want to set into the value.

my js variable in the form is cases = NWF$("#" + cases).val(34) does not work

please help as i need to get this into testing immediately.

Thanks

Labels: (1)
0 Kudos
Reply
2 Replies
Workflow Hero

Re: Form: Setting Value on Lookup field that allows Multiple values

you haven't specified what platform you need it for, but following should work on NF2013 on-prem

NWF$('#'+cases).closest('.nf-dataaccess').find('.allOptions option[value="34"]').prop('selected',true);
NWF$('#'+cases).closest('.nf-dataaccess').find('.addSelectedItems').click();‍‍
0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Form: Setting Value on Lookup field that allows Multiple values

I tried the same code in sharepoint online but it was not working.

NWF$('#'+WISteps).closest('.nf-dataaccess').find('.allOptions option[value="117"]').prop('selected',true);
NWF$('#'+WISteps).closest('.nf-dataaccess').find('.addSelectedItems').click();

0 Kudos
Accept as Solution Reply