Thank you for reporting an issue, suggesting an enhancement, or asking a question. We appreciate your feedback - to help the team understand your
needs please complete the below template to ensure we have the details to help. Thanks!
Please check out the Docs to see if your question is already addressed there. This will help us ensure our documentation covers the most frequent questions.
Please specify what version of the library you are using: [ 1.3.5 ]
Please specify what version(s) of SharePoint you are targeting: [ Online ]
I need to create a lookup field with pnpjs that allows multiple values. I tried adding the following
`
await list.fields.addLookup('myLookUpListName', 'GUID VALUE', 'Title', {AllowMultipleValues:true});
but get the error:
The property 'AllowMultipleValues' does not exist on type 'SP.FieldCreationInformation'
`
but can see that there is no type in the FieldCreationProperties to cover the multiple values.
Is there another way to create lookup with pnpjs that allows multiple values?
You need to make two requests. As the error tells you the AllowMultipleValues is not available when you initially create the field.
const fieldAddResult = await sp.web.fields.addLookup("Test Lookup 124", "GUID", "Title");
await fieldAddResult.field.update({
AllowMultipleValues: true,
}, "SP.FieldLookup");
Most helpful comment
You need to make two requests. As the error tells you the AllowMultipleValues is not available when you initially create the field.