- August 2, 2010 at 6:20 pm #542
I have a table in my form with the following columns: Start Date, End Date, Reason, and Units. The user enters as many rows as they need then press a button on the form that uses a connection action to send the data to the database
Before this data is sent, I want to be sure that no rows have a Start Date that is after the End Date, and the Units column is greater than zero.
I know I can use the Set Table Rows to move through the rows and use simple or multiple branches to check the data, but how do I know when I’m at the last row and determined that the data in all the rows is valid?
Here’s a screenshot of how I’m looping through the rows and checking the data. Where do I determine that I’m at the last row and can submit the data?
imgur.com/J21QW.pngAugust 2, 2010 at 7:04 pm #5375
After your “Move to next row” you will need a simple branch that checks if the last behavior was successful dl.dropbox.com/u/883792/loop.png. If your loop is on the last row and you try to move to the next row that behavior will fail and this simple branch will catch that. It has to be done immediately after the “Move to next row”. Also just checking, prior to your “Move to next row” you are setting the current row of the table to the first correct?August 2, 2010 at 10:40 pm #5379
That worked, thank you! And yes, I am setting the current row to the first row to begin with. I have a question about that, in fact. Is there a simpler way of doing this instead of doing 1) Set Table Rows:First Row 2) Checking the columns 3) Set Table:Next Row 4) Checking the columns 5) Repeat at 3).
Here’s the screenshot of what I have. The 1 and 2 labels are the exact same validations, once for the first row and then again for the remaining rows. I wasn’t sure if there was a better way to do this.August 3, 2010 at 1:17 pm #5380
You shouldn’t need two separate commands for validation. I don’t see a link for your screenshot, but if I understand correctly you could do this with just one.
1) Set Table Rows: First Row
2) Checking the current row
3) Set Table: Next Row
4) Simple branch: Last Behavior Successful? If true go back to 2) if not exit the loop.August 3, 2010 at 4:26 pm #5381
Sorry, here’s that link: imgur.com/utKoN.png. I think I get what you’re saying, though. Will give that a try. Thanks for all your help!August 3, 2010 at 4:44 pm #5383
Your suggestion worked. Thanks, again!
You must be logged in to reply to this topic.