Generating a fresh initialValue in an object for prefilling fields in a pageBuilder document.

1 replies
Last updated: Nov 1, 2023
Hi πŸ‘‹ Is there a way to generate a fresh
initialValue
in an object being used in a pageBuilder document? I'm trying to prefill a field with a random number using initialValue but the same random number keeps appearing upon adding additional "instances" of this same object
Nov 1, 2023, 7:55 PM
just figured it out. Returning a function instead of a string does the trick. Thanks πŸ˜„
Nov 1, 2023, 8:02 PM

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?