- August 25, 2011 at 11:58 pm #811
I have a database table with three fields: ID (unique), Name, Phone. I also have a Table object in my form with these same fields. Assume that the database table has five rows with IDs 1 through 5.
I want to update those five rows using my Table object. I added five rows to the Table object with IDs 1 through 5, and added name and phone data. How do I update all five rows in my database with the five rows in the Table object?
I tried the creating an UPDATE database connection action and used the ID column as the Send Condition Parameters and Name and Phone as the Send Value Parameters. In my form, I added a Connect behavior, and used the “all rows” values from my table for the connection parameters. The problem is that only the first row in the Table object is updated in the database. What step am I missing?August 26, 2011 at 8:12 pm #5828
Had an issue with the same thing. Connecting with “all rows” doesnt work – you have to use a behavior that moves through the table and connects/updates each time you have a record on a given row.
There are a few actions within the behavior you will need to get it moving:
* Set table row
* Simple branch
You will need to create a sort of “if statement” loop where you first set the table row to “move to first row”, connect and update the record (for the current row), set table row to next row, do a simple branch with an advance formula “last behavior was successful” – if true, the connector should go back to the connection/update action. If false, close, submit or whatever you need it to do.
You must be logged in to reply to this topic.