For the complete documentation index, see llms.txt. This page is also available as Markdown.

Edit an existing CCT record

This example shows how to build a front-end form that lets users update an existing record in a Custom Content Type (CCT) table.

Prerequisites

  • A CCT table (e.g. movies) with at least one column (e.g. title, year).

  • A form with the Fill Table (CCT) action and the movies table selected.

1. Create the form

In ACPT → Forms, create a new form and set:

  • Action → Fill Table (CCT)

  • Table to fill → movies

Leave Record blank — you will supply the record ID at render time via the shortcode.

Open the form builder and drag in the columns you want to expose (title, year, etc.). Save the form and note the Key shown in the forms list (e.g. e45b2639).

Form settings with Table record action
General settings for a Table record form, with the movies table and its columns selected.

2. Render the form for a known record

Use the record_id shortcode attribute to pre-load record 49:

The form renders pre-populated with the current column values of that record. On submission the record is updated in place.

In PHP you can build the shortcode dynamically — for example from a URL query parameter:

If record_id refers to a record that does not exist in the configured table, the shortcode renders an error message and no form is displayed.

3. Pin a record in the form settings

If you always want the form to edit the same record, set the Record dropdown in the form's general settings instead of using the shortcode attribute. The pinned record takes precedence over record_id.

4. Insert a new record

Omit record_id (and leave Record blank in the settings) to always insert:

Each submission creates a new row in the movies table.

Last updated