PerfectForms Forums » General

Update multiple rows in DB table from rows in Table object

(2 posts)
  • Started 9 months ago by pmeidinger
  • Latest reply from Derrick
  1. pmeidinger
    Member

    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?

    Posted 9 months ago #
  2. Derrick
    Member

    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
    * connect

    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.

    Posted 9 months ago #

RSS feed for this topic

Reply

You must log in or register to post.

Contact

1917 Palomar Oaks Way
Suite 160
Carlsbad, CA 92008
866.900.8588

  picture  picture  picture  picture