Select all values in lookup

Good day,
i have a multiple lookup field.
How can i by clicking checkbox "select all" - to select all values in lookup field?

Dear @ixxxl,
You could add a button with pnpjs code to retrieve all items, then create an array with all item IDs and populate the Lookup field with it.

How to retrieve all items you can check here - How To: Query List on Different SharePoint - #5 by mnikitina

How to work with pnpjs for filtering and such, check here - List Items - PnP/PnPjs

How to populate Multilookup field, here - Managing SharePoint fields with JS — SharePoint forms

@Nikita_Kurguzov
i tried as is in manual, but have some problems - values are populated but undefined

Cod in button:

fd.field('Sucursale_x0020_adresate').value=["400","401","402"];
console.log(fd.field('Sucursale_x0020_adresate').value);
console.log(fd.field('Sucursale_x0020_adresate').value[0].Cod_x0020_Subdiviziune); 

Dear @ixxxl,
Yes, the extra values are not available if you set the value with code. You can only retrieve these with pnpjs, as shown in the links above.

1 Like