Can I seed repeatable groups with some starting items?

Hello,

I'm wondering if it's possible to add a few default items to a repeatable group in the document type. By that I mean these two items ALWAYS come with the document even when you create a new one from scratch based on the document type. It would start with all fields blank except the group collection which would have the seeded items in it. These item can be deleted but you don't have to add them every time you create a new document on this type.

Here's the use case:

I have a document type composed of a repeatable group. Each group represents a paragraph in an email notification. So if you wanted your email to consist of 3 paragraphs, you'd create 3 groups. Now I'm finding that for every email notification, I have to always add the same two paragraphs at the end:

Thank you,

Your friends at [company]

It would be nice if each document of this type came with those two paragraphs from the start. The user can delete or change them if they feel they want a different signature, but they wouldn't have to re-type it every single time.

Is this possible?

1 Like

This sort of thing is discussed here: https://prismic.io/blog/required-fields

Solution 1: Empty document preview. Return all default values in the API if a field is left empty by an editor.

This solution caused a lot of predictability issues. It seems strange when you have empty fields in your editor and yet you can preview a full page with an entire set of content. Where is this Default title coming from?

Solution 2: Pre-fill a new document with all default values.

But then the editor will have to re-write everything, which is, again, an extra effort.

Hi @gibran, unfortunately the ability to have pre-filled content doesn’t exist with Prismic.

Thanks for sharing your use case. I will let the @features-team know about this and we will add this to our feature request tracker as a possible improvement for the future. We don’t have any plans to work on this right now, but we will let you know here if that changes at any point.

This is being tracked as an open feature request.

If you have another use-case for this feature, you can 'Flag' this topic to reopen. Please use the :heart: button to show your support for the feature and check out our Feature Request Guidelines.