🔮 Sanity Create is here. Writing is reinvented. Try now, no developer setup

How to Check if An Image Exists in a Document and Generate One if Not

1 replies
Last updated: Apr 29, 2021
I am using this plugin for generating images, but i want to automate it, lets say no image has been added, this plugin should automatically generate an image for the document
Apr 29, 2021, 5:38 PM
you'd probably want to use document actions, i.e. when a document is published, check if there's an image and create one if not.

https://www.sanity.io/docs/document-actions
Apr 29, 2021, 5:57 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?