Assign value to Cross-site Lookup

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
MES5464
Posts: 94
Joined: Mon Aug 26, 2013

09 Oct 2013

So, I want to set the cross-site lookup field of Employee to the current user when they open the form.

Using Microsoft SP I am getting the logged in user, and querying my Employee list for the ID.

I attempt to set the value of my Employee cross-site lookup field with the ID but I think the

cross-site lookup is still populating and so it ignores to attempt to assign the ID.

Or

The cross-site lookup will not accept an ID for a list item that isn't in the list yet. I have the

list currently set to pull the default about of list items (10) at a time.


Any ideas or suggestions?

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

11 Oct 2013

Hello,

You can assign ID to Cross-site Lookup but its display value will not appear in the control. In this case you can hide Cross-site Lookup field and set its value in the specific ID with JavaScript.

Another option is to set ID with display value if you know it. The following example is valid for Cross-site Lookup with single value:

Code: Select all

fd.field('InternalName').control().value({Id: 1, Title: 'Display text'});
You can find more samples in the following entry
http://spform.com/forms-designer- ... eld-values

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 21 guests