Linking a list to a 2nd table

How to link a form to a second database table without modifying the original table.

Overview

The issue arises when needing to save additional form data to a separate table while keeping the primary table unchanged and maintaining a reference between them.
Use two Save Data actions in the form. Configure the second action to save to the secondary table and set its foreign key field using the primary key value generated by the first Save Data action.

Answered
ChronoForms v8
em empulse 01 Jan, 2026

I have created a form that displays a list of records (rows) from a MySql table (i.e. Table-One).  I have created a second (edit) page that shows fields from Table-One (i.e. Name, phone, no. etc)  I want to add fields to the edit page that are not in Table-One  (notes, email address etc) to be saved to Table-Two but not to the original table (Table-One) .  There should be no changes, edits, deletions, etc to the rows in Table-One.  Table-Two should have references to the selected record (row) in Table-One.  Each time a user edits the record in Table-Two, the Joomla user ID should be saved.I know how to construct  SQL tables to do this, but I am flummoxed when trying to do this through the CF8 UI.

Can you provide some guidance?

(Joomla 6, Chronoforms 8)

Max_admin Max_admin 03 Jan, 2026
Answer

The edit page Submit will have 2 Save Data actions, one saving to table 1 and another to table 2, in the Modify Data Source of Save Data #2 you need to set the foreign key value using {var:save_data_1.id} assuming your table 1 primary key is named "id":

id={var:save_data_1.id} // change save_data_1 to the name of your save data to 1st table
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Post a Reply