Problem saving updates to data from a repeater area

How to save updates from a repeater area in ChronoForms.

Overview

The issue occurs because the form fields within the repeater area are not named correctly, preventing the save data action from receiving the submitted values.
Correctly name the fields using a structured array format. Then, set up an event loop with the data provider pointing to the submitted data array and configure the save data action within that loop to process each row.

Answered
ChronoForms v6
fa farscape 02 Sep, 2018
This post builds on this earlier one.

This is now a two-section/event form (but it's not a multi-page form). The first section/event captures a survey that consists of volunteer areas with checkboxes. It passes the respondent's ID via URL to the second section/event.

The second section loads the responses for that respondent, using the ID passed via URL. The intent is to allow the responded to select his/her top three choices.

I have an event switcher in the submit that successfully routes the submit actions of the two events. The submit for the first event works as expected. However, the save_data action in the second event does not seem to do anything. The debugger always shows Array ( ).

Clearly I'm missing something.

The second section contains area_repeater279, which contains area_fields280. The multi-field area shows two fields, the text of the volunteer area and the checkbox to indicate that this question is a "top 3" choice.

Any help is appreciated.

Here is how I've set up the second section and event ...

The fields in the multi-field area_fields280:

Problem saving updates to data from a repeater area image 1

Problem saving updates to data from a repeater area image 2


The loop to save the data:

Problem saving updates to data from a repeater area image 3

The save data:

Problem saving updates to data from a repeater area image 4

Here are the results:

Problem saving updates to data from a repeater area image 5
he healyhatman 03 Sep, 2018
Answer
You haven't named your fields correctly. Call them for example
responses[{var:area_repeater#.key}][is-top-3]
Then you will need an event loop, data provider should be {data:responses}. Put the save data in the body of the event loop, data override should look like this
field:{var:loop_event#.row.field}
This topic is locked and no more replies can be posted.