> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: insertReference(collectionId: string, propertyName: string, referringItem: any, referencedItem: any, options: WixDataOptions) # Method package: wixData # Method menu location: wixData --> insertReference # Method Link: https://dev.wix.com/docs/velo/apis/wix-data/insert-reference.md # Method Description: Inserts a reference in the specified property. The `insertReference()` function returns a Promise that resolves when a reference to the referenced item(s) is added to the referring item in the specified property. The Promise is rejected if the current user does not have update permissions for the collection. Calling the `insertReference()` function does not trigger any hooks. > **Notes:** > - The `insertReference()` function only applies to multi-reference fields. > - The `insertReference()` function is not supported for Single Item Collections. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Insert a reference ```javascript import wixData from 'wix-data'; // ... wixData.insertReference("movies", "actors", "00001", "12345") .then(() => { console.log("Reference inserted"); }) .catch((error) => { console.log(error); }); ``` ## Insert references using an array ```javascript import wixData from 'wix-data'; // ... wixData.insertReference("movies", "actors", "00001", ["12345", "67890"]) .then(() => { console.log("Reference inserted"); }) .catch((error) => { console.log(error); }); ``` ---