I’m trying to do some data conversions as I’m merging two databases. What I’d like to do is create several serverconnect files which go through each record in a table, I’d like to be able to use the values in the record to update a value if certain conditions exist. The conditions could involve doing another database search on another table looking for certain values in other fields. It seems that server connect could do this but I just don’t know the syntax. Any more documentation on database multiple update?
Sound like a multi stage server action with a lot if loops. You may find custom queries the best route rather than lots of loops. Some examples could help me be more specific
Here is an example. I have 2 tables. One for events and one for projects for the event. The project records have an event_id field to reference which event the project belongs to. The projects table has a categories field too for differnt types of project like photo or video coverage. The events table has an event_type field for the kinds of events like weddings, corporate etc.
I didnt have the event_type field for older projects so that field is empty. I would like to have an action which sets the event_type field to ‘Weddings’ in the events table gor all events records where there is a project in the projects table with category equals ‘wedding photography’ or ‘wedding videography’.
I have an action that can do this but for one record which is run from an edit button on a page where there is a table of all events with an edit button in every record. I can click on the event and the action determines if the event is a wedding or not and sets the event_type correctly. I just would like it done to all records instead of pushing the edit button for all 1000 records. Does that make sense.? I think i just need to know how to use repeat in a server action where the repeat condition is a database query of the events records. Just dont know how to reference each record in the repeat loop. I just cant find any docs about repeats in server actions which go into that type of detail. Thanks for all your help as always.