Is your Microcopy unique?
A custom validation to check if your Microcopy documents have unique keys and values for a specific namespace.
Go to Is your Microcopy unique?A custom validation to check if your Microcopy documents have unique keys and values for a specific namespace.
Go to Is your Microcopy unique?This validation can be used if you have two fields and you require one or the other to be filled
Go to One or the other validationPopulate your list options in a string schema using an external API
Go to Asynchronous List Options ComponentUse the renderDefault function to easily control your available array options.
Go to Filter Array Options Based on the Current User RoleSimple custom validation that force array length according to another field.
Go to Custom validation on array lengthSuppose you have an Array Reference to Category and you want to get all posts with one of the categories listed in the current post. This is usually when you need to get related items.
Go to Get related items of a post in sanity by comparing category array reference with another arrayA short snippet to filter category, tags or other document based on total referenced count.
Go to Sanity GROQ Filter category by highest reference count in other documentsSometimes you want to validate items in an array, here is how
Go to Validation of Array ItemsAfter the approval (switch to true), the date of this operation is stored in a hidden field.
Go to Custom Input Component: Save the date of document approvalSnippet for `internalLInk` Reference in GROQ and rendering it in React/Next.js frontend using Portabletext.
Go to Sanity internalLink render in React with Portable TextCustom input component with a DIY webhook for connecting to APIs beyond publish, update, and delete events.
Go to Custom Input Component with WebhookInternal/External link based on the conditional field example with Next.js component starters
Go to Internal/External Next.js LinkSanity provides various custom functions inside the schema. But getting a reference field value is difficult. Here's the how I do it using fetch.
Go to Get Sanity Reference Field Values inside Custom Schema FunctionsMigration script to convert plain text to block content across your content lake
Go to Migrate plain text field to Portable TextSchemas for adding richer quotes within Portable Text
Go to Rich quotations in Portable TextThis snippet will return only matched item in a sub array inside a document
Go to Sanity groq Filter by item in an arrayVisually browse the reference documents you want to select in a document.
Go to Reference document browser inputRun GROQ queries in the studio to populate an array module.
Go to GROQ Reference Lookup + Add & Replace