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

Question

Question

how do I pull data from sql db into a form table field?

asked on May 11, 2023

I want to pull ALL data from a sql db view into a form table field. I know to use the Lookup Fields to point to the db value to populate the column but I'm missing that trigger as to what rows I want because I want them all. This sql view includes only active projects so everything in the view is relevant. As the project closes than it will no longer reside on the sql view. How can start this process with only the one form and have it populate automatically or is this not possible or am I using the wrong approach?

Lucinda 

0 0

Replies

replied on May 11, 2023

You can use a lookup to pull all data simply by not including a Condition and checking the "as new rows" option for each column. A lookup with no conditions will return every value in the target table/view.

When there is no condition set, the lookup will still be triggered when the form is loaded because there is an initial "onloadlookup" process that runs when a form is opened.

In the following example, I have a lookup that is targeting a table named "test" but it has no conditions set so it will always return every row of that table.

It is worth noting that large data sets can take a significant amount of time to load. When a lookup returns data, it not only has to process all that data, but it also has to build out the HTML elements on the form, so the number of rows and columns will have a noticeable impact on performance of the web form.

For example, a table with 5 columns and 10 rows might load pretty quickly, but a table with 5 rows and 500 columns would take noticeably longer because it has to do a lot more work not just to transfer the data, but also to build the rows into the HTML of the form.

0 0
replied on May 11, 2023

That is what I thought but the form populates with no data so I'm guessing I'm missing a step

I'm sending an email with the form but it does not have any data - I'm missing something, right?

 

0 0
replied on May 11, 2023 Show version history

You are missing the "as new rows" checkboxes on the lookups in that screenshot.

1 0
replied on May 11, 2023

As Matthew mentioned, the "as new rows" checkbox is required, but the easiest way to test the lookups is to look at them on the form without submitting and go from there to the next steps.

A lot of things could happen, for example, if you are using field rules to hide the table from the submitter, then maybe you have it set to ignore the data. Not saying that's the issue, just saying you should take it one step at a time.

I'm not entirely sure based on your description, but it is also worth noting that lookups do not run "unattended" meaning the lookups only run when the form is opened by an actual user.

For example, if you have two form instances, one started by a user, and another initiated by workflow, only the first one would have any data associated with the lookups because the form started by workflow wouldn't trigger lookups.

2 0
replied on May 22, 2023

Thank you, everyone's responses helped!

0 0
replied on May 12, 2023

Ah, this is interesting!

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

Sign in to reply to this post.