I ran into the problem of not being able to set multi-value lookup field using spjs.utility.updateItem() and stumbled upon the solution and wanted to share as I don’t believe this has been addressed.
Initially I thought something like this would work (but it doesn’t):
spjs.utility.updateItem({
'listName' : 'GUID of list to be updated',
'id': 'ID value(s) of items to be updated',
'data' : {
'MultiValLookupField' : ['ID1', 'ID2', 'ID3']
}
)}
However, this is what actually worked:
spjs.utility.updateItem({
'listName' : 'GUID of list to be updated',
'id': 'ID value(s) of items to be updated',
'data' : {
'MultiValLookupField' : 'ID1;#;#ID2;#;#ID3'
}
)}
I expected the syntax to be similar to setFieldValue() where you can do:
setFieldValue('MultiValLookupField' , ['ID1', 'ID2' , 'ID3'])
but this was not the case, so be aware of this.