👀 See Sanity in action: Watch product demo now →

Do you need Initial Values to Create a Document using client.create()?

2 replies
Last updated: Apr 15, 2020
Hi! Im creating a document via client.create(). Im purposefully not sending some fields because I have those being set by ‘Initial Values’, But those fields are being left empty when creating the document via client.create. However ‘Initial Values’ is correctly working when I create a new document in the Sanity UI. Can anyone let me know if Im missing something here 😅 Thanks!
Apr 15, 2020, 12:26 PM
Sorry if this wasn't clear from the documentation: Initial values are studio only. You'll need to implement the same values from where you are creating the documents from the API.
The datastore is schemaless (for now).
Apr 15, 2020, 12:27 PM
Awesome, I missed that in the docs! That was my next step but I figured I’d double check. Thanks
user Y
Apr 15, 2020, 12:31 PM

Sanity.io – build remarkable experiences at scale

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

Categorized in