How can I create a single-use global data model?

I want to create a centralized place for global options that will only be set once, e.g. website name or default social image. Is there a way to set up a data model that can only ever have a single entry?

Hi @JonathanLand,

Yes, you can set this out using builder data models. Please check Data Models - Builder.io and let us know if you’ve further questions!

Hey, thanks for the reply. However, every example I see is for models where I would want multiple entries (e.g. blog authors). I’m looking for a way to explicitly limit the model to a single entry, i.e. a piece of data there can be only one of (e.g. website name). How can I achieve this?

@JonathanLand, To put a limit on a model to have a single entry. You can use Using model validation hooks - Builder.io.

To centralize like website name, default image, etc. you can use Custom fields - Builder.io in the Data model and use it anywhere in the page or section model type content.