Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

How to bind Adaptive Form Fields of a Repeatable Section to Database?

Avatar

Avatar
Springboard
Level 4
Ssb_94
Level 4

Likes

45 likes

Total Posts

118 posts

Correct Reply

3 solutions
Top badges earned
Springboard
Establish
Affirm 3
Contributor 2
Give Back 25
View profile

Avatar
Springboard
Level 4
Ssb_94
Level 4

Likes

45 likes

Total Posts

118 posts

Correct Reply

3 solutions
Top badges earned
Springboard
Establish
Affirm 3
Contributor 2
Give Back 25
View profile
Ssb_94
Level 4

12-02-2021

Hello Folks,

We are currently working on a requirement, where I need you guys help.

 

We have a form created with Form Model selected as FDM and connected to MySQL DB. It has one Repeatable Section / Panel and we used an Instance Manager as the option for doing the same, which has 2 buttons (Add and Remove). We used a Fragment for creating that panel and properly binded to DB fields.

When we try to insert data into DB using FDM service, expected scenario is if a user adds one more entry of same section with different details, then in the DB, I should see 2 records inserted (we have a logic at our end which is based on Unique Identifier at table level). But currently I see only 1 record getting inserted every time. I was assuming that section with proper binding is the one which is repeated, then same binding should be applied there too, but I doubt whether it was happening or not.

 

Can someone please help in understanding of  following questions on 

1. How this repeatable sections work especially while binding and doing DB operations? I explored the follow documents, but unfortunately couldn't able to get much info. Repeatable Section,

Similar question posted

2. What is the best approach for creating repeatable sections out of available one's like Accordion, Instance Manager, XDP Subform and XSD?

 

Quick help is appreciated!

@Mayank_Gandhi @smacdonald2008 

 

Regards,

Sri Bhargav

AEM Forms AEM Forms Designer FormsService

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Ignite 1
Level 7
GirishBedekar
Level 7

Likes

167 likes

Total Posts

239 posts

Correct Reply

37 solutions
Top badges earned
Ignite 1
Give Back 5
Give Back 3
Give Back 10
Give Back
View profile

Avatar
Ignite 1
Level 7
GirishBedekar
Level 7

Likes

167 likes

Total Posts

239 posts

Correct Reply

37 solutions
Top badges earned
Ignite 1
Give Back 5
Give Back 3
Give Back 10
Give Back
View profile
GirishBedekar
Level 7

12-02-2021

Answers (5)

Answers (5)

Avatar

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct Reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct Reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile
Mayank_Gandhi
Level 10

18-02-2021

@Ssb_94  You need to make sure the row is bound to an element in data source which is a repeating element and that would work fine. I prefer using XSD or JSON schema.

Avatar

Avatar
Springboard
Level 4
Ssb_94
Level 4

Likes

45 likes

Total Posts

118 posts

Correct Reply

3 solutions
Top badges earned
Springboard
Establish
Affirm 3
Contributor 2
Give Back 25
View profile

Avatar
Springboard
Level 4
Ssb_94
Level 4

Likes

45 likes

Total Posts

118 posts

Correct Reply

3 solutions
Top badges earned
Springboard
Establish
Affirm 3
Contributor 2
Give Back 25
View profile
Ssb_94
Level 4

18-02-2021

@Mayank_Gandhi , could you please provide some more details on what exactly you mean by term "row". Is it entire repeatable section? Also what does element in the data source mean?

An example of this would help understand better.

Avatar

Avatar
Springboard
Level 4
Ssb_94
Level 4

Likes

45 likes

Total Posts

118 posts

Correct Reply

3 solutions
Top badges earned
Springboard
Establish
Affirm 3
Contributor 2
Give Back 25
View profile

Avatar
Springboard
Level 4
Ssb_94
Level 4

Likes

45 likes

Total Posts

118 posts

Correct Reply

3 solutions
Top badges earned
Springboard
Establish
Affirm 3
Contributor 2
Give Back 25
View profile
Ssb_94
Level 4

15-02-2021

Okay we're able to prefill the data for Repeatable sections, it's just that I need to return the data as an array in FDM service for form to understand and fill the data for all sections.

Thanks all for your responses!

Regards,

Sri Bhargav

Avatar

Avatar
Springboard
Level 4
Ssb_94
Level 4

Likes

45 likes

Total Posts

118 posts

Correct Reply

3 solutions
Top badges earned
Springboard
Establish
Affirm 3
Contributor 2
Give Back 25
View profile

Avatar
Springboard
Level 4
Ssb_94
Level 4

Likes

45 likes

Total Posts

118 posts

Correct Reply

3 solutions
Top badges earned
Springboard
Establish
Affirm 3
Contributor 2
Give Back 25
View profile
Ssb_94
Level 4

15-02-2021

Thanks for the response! Yes looks like FDM Service is going to insert only 1 record at a time. That's fine we can invoke that service for each and every section separately.

 

But what about prefilling data for the sections while using retrieving / get service? When user saves the form and sometime later comes back to complete submission, I should pre-populate data saved in DB for all sections filled by user earlier. Please help

 

Regards,

Sri Bhargav

Avatar

Avatar
Ignite 1
Level 7
GirishBedekar
Level 7

Likes

167 likes

Total Posts

239 posts

Correct Reply

37 solutions
Top badges earned
Ignite 1
Give Back 5
Give Back 3
Give Back 10
Give Back
View profile

Avatar
Ignite 1
Level 7
GirishBedekar
Level 7

Likes

167 likes

Total Posts

239 posts

Correct Reply

37 solutions
Top badges earned
Ignite 1
Give Back 5
Give Back 3
Give Back 10
Give Back
View profile
GirishBedekar
Level 7

13-02-2021

I am not sure if insert operation of FDM can insert more than one row at a time