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

Question

Question

Live Lookup

asked on August 13, 2014

 Is there a way to script a live look up of the form. There will be static values on the first page and we want that values to be looked up in a table in drop down fields.

0 0

Replies

replied on August 13, 2014

I'm not sure what you mean by "live lookup". Lookups can be performed to populate drop-down lists though.

0 0
replied on August 13, 2014

and furthermore, you can use javascript to invoke lookups if they are not automatically being loaded. But that does not seem like something necessary in this situation.

 

Can you explain some more about what you want to do.

0 0
replied on August 13, 2014

Yes you have option to tie in to the database in LF forms. 3 easy steps.

 

Step 1 : Click on the Gear icon on right, add the data source (your sql server)

 

Step 1 - Go to Manage Add DB source

 

Step 2: Add your database source

 

 

Step 3: On the Form first create all your fields etc. and go to the Lookup Rules and create your sql rules tie in to the

0 0
replied on August 14, 2014

Hi,  let me try to explain in a little more detail.

In the picture above there is a table were we manually enter the SRN's, this is a manual process.

In the image below is a table for labour detail. So instead of retyping all the SRN's we want to let the SRN field in the Labour table be a lookup based on what was entered above.

 

is this possible with some script? 

0 0
replied on August 19, 2014

If you intend to use that initial SRN field to run a database lookup to fill corresponding table rows, this is possible out of the box. Here I have manually entered in the employee name field, and a lookup fills in the rows in the table with the each employee's ID and location. 

 

 

Here is what the lookup looks like:

 

 

This works great as long as there are a matching number of rows in the collection and the table. If the rows mismatch some funky stuff happens. I would enter a set number of rows for the collection and table to make sure they match.

 

If all you wanted to do was map the values from the initial SRN field to the SRN field within the table, this can be done using JavaScript. 

0 0
replied on August 19, 2014

yes we want to use javascript, but it only works for one row in the table.

0 0
replied on August 19, 2014

you will need to use javascript to activate that button to add a row, or reproduce that functionality output in javascript, in order to have it add rows. You will then need to modify the javascript to iterate through your new rows and apply the proper value in the order they were input in the earlier table.

0 0
replied on August 26, 2014

Hi Kenneth. Thank you very much. I am not very good with Java Script, can you please post some sample codes for this functionality?

0 0
replied on August 26, 2014

I am not able to devote the time to give you exactly what you need, but I would recommend taking a look at the following links to find what parts you will need:

 

The answer to this LF Answer will help in figuring out what you will need in order to change the table. You will obviously need to modify it to include the columns you are wanting and to pull information from another table. I hope this helps. The code in the selected answer also helps add in rows via javascript and not require user interaction.

https://answers.laserfiche.com/questions/55591/Populating-a-table-with-a-sql-lookup-values-via-dropdown-options-without-user-interaction

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

Sign in to reply to this post.