Repeatable forms
Question

Hello, 

I'm trying to create a form where in certain sections, you can call the form multiple times, like this picture:

I've created the input fields and put them into separate containers. I've added an icon and associated a screen action, but I'm kind of stuck on how to add the same fields over and over. Is there something pre-built or an already existing option in the Service Studio that can do this automatically?

Thanks


Hi Miguel Silva,


I developed an example for you. I used Seema's base, however added some changes. 


Instead of adding empty records into the database, I chose to work with a local variable that will hold all of your values. Then, you just need to guarantee that when submiting the form, all the information is transfered correctly into the database without duplicates.



Best regards,


João Delgado


Form.oml

Hi Miguel,


Do you need to create this form a set amount of times or dynamically?

Dylan Heunis wrote:

Hi Miguel,


Do you need to create this form a set amount of times or dynamically?

Dynamically. If it was a set amount of times, I could use the rich widget: "Container_ExpandCollapse" for example but I will have no control how many times they can be repeated



Your best bet would be to wrap the form you need inside of a web block.
That block can then be instantiated however many times you need and within a List Records widget for example.

Dylan Heunis wrote:

Your best bet would be to wrap the form you need inside of a web block.
That block can then be instantiated however many times you need and within a List Records widget for example.

Hi Dylan and Miguel,

In addition to Dylan's solution, you'll also need a screen action and to ListAppend an element with a local variable datatype Record containing attributes for the Input widgets First and Last to the ListRecords widget so that you can add more of those Forms as needed.

Since you're using webblocks, an Event to pass the data from the webblock to the parent webscreen would also be needed.

Kind regards,

Joseph Enriquez


Miguel Silva wrote:

Hello, 

I'm trying to create a form where in certain sections, you can call the form multiple times, like this picture:

I've created the input fields and put them into separate containers. I've added an icon and associated a screen action, but I'm kind of stuck on how to add the same fields over and over. Is there something pre-built or an already existing option in the Service Studio that can do this automatically?

Thanks


Hi Miguel,

 Check the attached oml, this may help you.

regards

seema


RepeatedForms.oml

Hi Seema, I found your solution really useful..But I need to do the same in Reactive web app but i couldnt find "listrecords" widget which is used in your module..So Could you please help me out how to achieve this in reactive web app

Thanks in advance

Hi Miguel Silva,


I developed an example for you. I used Seema's base, however added some changes. 


Instead of adding empty records into the database, I chose to work with a local variable that will hold all of your values. Then, you just need to guarantee that when submiting the form, all the information is transfered correctly into the database without duplicates.



Best regards,


João Delgado


Form.oml

Thank you all for your great answers! A way I ended up doing to circumvent my problem was through a pop-up, where it would list a new empty record list so the user would fill it and then close it. 

But João's example is perfect for what I need. Thank you again :)

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.