You are viewing limited content. For full access, please sign in.

Question

Question

How do I configure a form to display all sql table contents and then update SQL?

asked on February 21, 2017 Show version history

I have a simple 5 column table in SQL.  (See below)

I would like my LF form to populate the entire contents of the table, similar to how an Excel spreadsheet can be populated with the contents of an entire table.

Then, the user would delete some rows within the form.  And when the table is Submitted, it would update the SQL table by removing the same data rows from the table in SQL.

Is this something that Forms can accomplish?

 

0 0

Answer

SELECTED ANSWER
replied on February 23, 2017

You can just use Fill Only with no When's as a lookup rule. Just Delete the When Line, Set the Fill Fields to be read/filled, when the form is launched it will automatically Fill the fields with the all the data in the DB.

I may still suggest that you have a Query to limit the returns as you could be talking about a lot of entries based on how big the DB table is.

1 0

Replies

replied on February 21, 2017

Hi Jason,

A query in Forms 10.* can populate a Complete Table, you need to set that Table as Append Data, and in the lookup Rule, choose the "As a New Row" on the Fill Lines.

To be able to mark a row for deletion, I would add a Row to you table on the right (call it Delete), that would be Checkbox Field the user would check that they wanted to delete that row. Then once the Form is submitted, have it kick off a LF Workflow that will read the table, For Each Row, with a Decision, Left Branch (Checkbox Not Checked) nothing happens, Right Branch (Checkbox Checked), in the Right Branch, you would need to create a Custom Query which would delete the Line of Data from the SQL DB. Just make sure you test this thoroughly as once the data is Deleted in the DB, it is gone for good.

 

2 0
replied on February 23, 2017

Sounds like a good idea.  However, what is the initiator to have Forms pull all the data from the table?  In past lookups, I would have a query based on date, or part or something similar.  In this instance, I just want Forms to pull everything in.

0 0
SELECTED ANSWER
replied on February 23, 2017

You can just use Fill Only with no When's as a lookup rule. Just Delete the When Line, Set the Fill Fields to be read/filled, when the form is launched it will automatically Fill the fields with the all the data in the DB.

I may still suggest that you have a Query to limit the returns as you could be talking about a lot of entries based on how big the DB table is.

1 0
replied on February 23, 2017

Awesome.  It didn't occur to me that I could remove that line.  its working great!  Thanks

0 0
replied on October 3, 2021

The As a New Row information was great information!  Thank you!

Christine

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.