> 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: data.items.bulkPatch(dataCollectionId: string, itemIds: Array) # Method Link: https://dev.wix.com/docs/sdk/business-solutions/data/items/bulk-patch.md # Method Description: Creates a bulk patch to modify the specified items. Unlike [`bulkUpdate()`](https://dev.wix.com/docs/sdk/backend-modules/data/items/bulk-update.md), only the fields specified in the request are modified. Data that isn't explicitly modified remains unchanged. The `bulkPatch()` method builds a bulk patch to modify multiple data items in a collection. It returns a `WixDataBulkPatch` object that contains the bulk patch definition, which you can further refine by chaining [`WixDataBulkPatch`](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-bulk-patch/introduction.md) methods onto it. These methods allow you to clear, set, and increment field values, as well as add or remove items from array fields. The methods are applied in the order in which they are chained. Finally, to run the bulk patch, chain [`run()`](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-bulk-patch/run.md) as the last method. Calling the `bulkPatch()` method triggers the [`beforeUpdate()`](https://dev.wix.com/docs/velo/api-reference/wix-data/hooks/before-update.md) and [`afterUpdate()`](https://dev.wix.com/docs/velo/api-reference/wix-data/hooks/after-update.md) hooks for each patched item, if the hooks have been defined. > **Notes**: > - This method does not support multi-reference fields. For multi-reference fields, use [`insertReference()`](https://dev.wix.com/docs/sdk/backend-modules/data/items/insert-reference.md) or [`replaceReferences()`](https://dev.wix.com/docs/sdk/backend-modules/data/items/replace-references.md). > - This method is limited to 100 items per method call. > - You can only patch items in [collections created by Wix users](https://support.wix.com/en/article/cms-formerly-content-manager-creating-a-collection). Items in [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code.md) cannot be patched. > - [Translatable collections](https://support.wix.com/en/article/wix-multilingual-translating-cms-collection-content) do not allow insertion and modification of items when working in a non-primary language. For example, if a collection's primary language is English, and the site visitor is viewing the site in French, calling `bulkPatch()` fails and issues an error. > - When an item is patched, its `data._updatedDate` field is updated to the current date and time. > - The maximum size of a patched collection item is 500kb. > - If an item ID isn't found, the `errors` array in the response returned by [`run()`](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-bulk-patch/run.md) contains a corresponding item with details about the error. Learn more about [Wix Data Error Codes](https://dev.wix.com/docs/sdk/backend-modules/data/wix-data-error-codes.md). # Method Permissions: - Write Data Items # Method Permissions Scopes IDs: - SCOPE.DC-DATA.WRITE # Method Code Examples: ## Patch multiple items in a collection ```javascript import { items } from "@wix/data"; async function bulkPatch() { const results = await items.bulkPatch("BlogPosts", ["fb071093-9a40-432d-ae1f-2e5966fecbfa", "9fe1a67f-fc60-4e99-8898-3f9e719ca62f"]) .appendToArray("tags", "travel") .setField("published", true) .run() const updated = results.updated // 2 const errors = results.errors; // [] } ``` ## Conditionally patch multiple items in a collection. ```javascript import { items } from "@wix/data"; async function bulkPatch() { const filter = items.filter().eq("published", false); const results = await items.bulkPatch("BlogPosts", ["fb071093-9a40-432d-ae1f-2e5966fecbfa", "9fe1a67f-fc60-4e99-8898-3f9e719ca62f"]) .appendToArray("tags", "travel") .setField("published", true) .run({ condition: filter }) const updated = results.updated // 2 const errors = results.errors; // [] } ``` ## default ```javascript try { const result = await items.bulkPatch("collection-0.4366748027349079", ["6892593d-d57f-428d-bc53-3f0870a1beef"]); return result; } catch (error) { console.error(error); throw error; } ```