Separate Entries for Each Repeater Field Entry

By: Finny Philip | Asked: 08/17/2023
ForumsCategory: How-toSeparate Entries for Each Repeater Field Entry
Finny Philip asked 1 year ago
Hi community, First time here. Trying to create a bit of complex webapp using Formidable Forms + Views and ran into a bit of an issue. Was just wondering if it is possible to save a repeater field entries as separate entries connected to the parent fields outside the repeater field. For example:

Form Schema:

Student Name: Current Academic Year:

Repeater Field:
  1. Subject Assigned
  2. Teacher Assigned
  3. Marks Rec
  4. Total Marks
For a frontend implementation, please see the attached file. Can that be used to create multiple, individual entries linked to the one parent detail. For example:

Entry 1: Student Name: Student 1 Current Year: Year 1 Current Semester: Semester 1 Current Program: Program 1 Repeater Subject Assigned 1 Repeater Teacher Assigned 1 Marks Rec 1 Total Marks 1   Entry 2: Student Name: Student 1 Current Year: Year 1 Current Semester: Semester 1 Current Program: Program 1 Repeater Subject Assigned 2 Repeater Teacher Assigned 2 Repeater Marks Rec 2 Repeater Total Marks 2   Hope I was able to explain what I am looking for. Any help from the community, pointing in the right direction, would be a big help.   Warm regards
Attachments
1 Answers
Victor Font answered 1 year ago
In a way, everything is already linked. Repeaters are an example of an embedded form. Each row in a repeater is a form entry in it's own right. The repeater form is linked to the parent form. When Formidable processes entries, it processes embedded forms first, which means there is not parent entry ID to link a repeater row to until the parent form is processed after the embedded forms. You could include a hidden field on the repeater to capture the parent entry id, but you would have to run an update process in the frm_after_create_entry hook for the parent form.
Victor Font replied 1 year ago

That being said, you are populating the dropdowns with data from where? If you are using dynamic fields, you are linking the repeater entry to the dropdown's lookup entry. This provides an incredibly flexible data access design that may help in realizing your requirement.

Finny Philip replied 1 year ago

Thank you for your response.

I am using dynamic fields as dropdowns, from other form entries, in order to keep the data linked. I can even create a system where I put in individual entries. But the repeater field offers the option to process data in bulk on the frontend. But outputting that in a view, and then putting in place a frontend edit option based on entries assigned to specific users is proving to be a bit of a headache.

Victor Font replied 1 year ago

From your question and response, it seems like you’re an experienced developer. This requirement is also a bit advanced that is more easily solved by a custom solution. Do you know how to write shortcodes to output content?

Sometimes, the metadata schema that both WordPress and Formidable employ can be a little difficult to navigate to fulfill advanced requirements like yours. In cases like this, I write my own shortcodes for views so I can control the data extraction and display operations using custom SQL. It gives me a lot of flexibility.

You have the entire global $wpdb object available to you to do your own custom work. And if you’re comfortable writing PHP code, field keys are your friend, not field ids.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right