Hello,
How I Can add lookup value multiple type when creating a list item?
I use this code
var lookupValTitle = new SP.FieldLookupValue(); var lookupCollection = []; var listItemEnumerator = collListItem.getEnumerator(); while (listItemEnumerator.moveNext()) { var oListItem = listItemEnumerator.get_current(); listItemInfo1 = oListItem.get_item('ID'); lookupValTitle.set_lookupId(listItemInfo1); lookupCollection.push(lookupValTitle); }
when I check the array lookupCollection, I can see that it has several meanings.
Then I write this array to another list:
oListItem.set_item('WhoGet', lookupCollection); oListItem.update(); clientContext.load(oListItem);
And when I check the list, I see that only the last recorded value of the array.
Why is this happening? Any ideas?