I’m trying to do my first multi-insert and am going round in circles… could someone tell me where my simple error is please?
Situation
I have a test_item table with various fields like first_name, last_name. A test_item can also have one of several regions they are associated with, so I have:
-
A lookups table with columns id and lookup_name which provide the list of regions.
In my example I have lookups[8]=North, lookups[9]=South. -
A test_item_regions table to store the list of regions for each test_item.
Setup - Array of Selected Regions -
selected_regions
I have created a user interface to select the different regions:
These are stored in the array selected_regions
. I know this is populated as it creates the display showing North and South in the above image.
Setup - Server Action -
update_test_item
In my Server Action, I bring the reference to my array selected_regions
through with a $_GET:
and then created a multi-insert
In the Database Insert part of the multi-action, I insert the array value as follows:
And to set the $_GET variable, back in App Connect I have a Server Connect element for the Server Action, setup as follows:
What Happens
The form which activates the update_test_item
Server Action:
- Writes the simple field values such as first_name, last_name okay
- Deletes existing entries in test_item_regions okay.
- The Insert Multi doesn’t insert the new values.
What I’d Like to Know
Is where I have gone wrong in passing the array selected_regions
through to the Server Action multi-insert!
Last updated: