Best way to copy an array field between documents in Sanity?

5 replies
Last updated: Jan 28, 2026
Hey all, best way to copy an array from a product to another product ?
For example if I want all this copied to another page, what would be the best way?
AI Update

Good news - Sanity Studio has built-in copy/paste functionality for array fields that makes this pretty straightforward!

Using Built-in Copy/Paste (Easiest Method)

Sanity Studio supports native copy/paste operations for array fields. Here's how:

  1. Open the source product in Studio
  2. Click the Field Actions menu (three dots) next to the array field you want to copy
  3. Select "Copy" (or use Ctrl/Cmd+C when focused on the field)
  4. Open the destination product
  5. Click the Field Actions menu on the target array field and select "Paste" (or Ctrl/Cmd+V)

This works for entire arrays or individual array items. You can even copy items between different document types as long as the field structures are compatible.

Programmatic Approach

If you need to copy arrays between many products or automate the process, you can use the Sanity Client:

import {createClient} from '@sanity/client'

const client = createClient({
  projectId: 'your-project-id',
  dataset: 'your-dataset',
  token: 'your-token-with-write-access',
  apiVersion: '2025-02-19'
})

// Get the source product
const sourceProduct = await client.getDocument('source-product-id')

// Copy the array to the destination product
await client
  .patch('destination-product-id')
  .set({ yourArrayFieldName: sourceProduct.yourArrayFieldName })
  .commit()

Cross-Dataset Copying

If you need to copy between different datasets or projects, check out the Cross Dataset Duplicator plugin which handles migration of documents and assets between Sanity projects directly from Studio.

The built-in copy/paste is definitely your quickest option for one-off copies!

Show original thread
5 replies

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Was this answer helpful?