How can we create repeater custom field in builder?

Repeater Fields

I want to create repeater fields in builder. I want to give option to add text and iframe as repeater field. I also wanted to add separate repeater field to add iframes. Is it possible in builder? If yes, then how can i achieve it.

Hi @anupama.sharmaa could you expand on what your use case is? What exactly are you looking for when you say repeater field? Want to make sure we are bale to get the best solution to fit your needs!

I want to create two fields: writing First for plain text and second for add iframe(boolean true or false) . By default, it will show one row. But i want to give option to add multiple rows according need (repetitive fields on click) and need a option under iframe(boolean), If it sets to true then a field appear to enter iframe.

Hi @anupama.sharmaa understood! This is definitely possible within Builder. What you are looking for is the List input type. Just create a custom field on your model with input type list, and then you can define the inputs underneath it. In this case you would have a text field, a boolean for if you need an iFrame, and then the url field for your iFrame source URL.

It could look something like this:

Then when you author content, you can dynamically add as many as you like:

Currently we dont have a way to set one field to be dependent on another (only show the URL field if needsIFrame is true), but you could definitely clean this up to not even need to boolean, and just have the iFrame URL be an optional field and then wherever you use it in your code say if this field is authored, then add the iFrame element

Hope that makes sense, let me know if you have any other issues or follow up questions!