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

Question

Question

Forms Drop Downs Disappear with Database Lookup

asked on March 18, 2014

 

I've added a lookup rule to pull data into a form when it can find a match for a unique id field.  When it can't, I want the user to be able to fill out the form manually. 

 

Since I added in the lookup rule, the drop down lists on the form will not and show the available options if I put in a unique ID that doesn't exist in my lookup table and want to fill out the form manually.

0 0

Answer

APPROVED ANSWER
replied on March 15, 2023

Per this post:

This has been fixed with Forms 11 Update 3.

When the dropdown field has "Append choices to lookup results" selected and there is only one result from lookup rule, the lookup result will be auto selected. 

You can see other changes of Forms 11 Update 3 from  https://support.laserfiche.com/kb/1014413/list-of-changes-for-laserfiche-forms-11-update-3 and get Forms 11 Update 3 from Laserfiche 11 package  https://support.laserfiche.com/kb/1014263/software-versions-and-fixes-included-in-the-laserfiche-11-download-package

1 0

Replies

replied on August 11, 2019

Currently on Laserfiche 10.3 and Forms 10 and I still see this issue where look up rule will remove the list of drop down choice I have initially. 

 

Was there anyone who could fix this?

3 0
replied on June 14, 2016

We are also running Forms 9.2 and like Jason and Jonathan mentioned, the still seems to be the behavior. Was there a hotfix or something else that we can do that fixes this?

1 0
replied on March 18, 2014

Let me see if I understand: You have a lookup rule that matches the value entered in a field and, if a match is found, some drop-down lists are populated with values. If a match is not found, these drop-down fields are not showing any options?

 

Please provide more details and screenshots if possible to illustrate the issue.

0 0
replied on March 19, 2014

Sorry Eric, I may not have been very clear.  I have a Police Warrant Intake form that contains drop down lists for things like Day of the Week, Gender, Race, etc.  Those drop down lists have values users can choose from.  When I don't have a Lookup Rule on the Form, users can fill out he form manually and pick from those lists without issue.  If I put a Lookup Rule on the Form to try and populate items on the form (Defendant name, Address, Phone, Gender, Day of the Week, Race.), based on a key value (Case Number) the drop down lists do not show their values. 

 

I would like the form to be able to pull from the external database when possible, but if a matching key value (Case Number) in the external database can't be found, I would like the users to be able to fill out the form manually.

 

I've made a copy of the form and when I remove the Lookup Rule, everything works great (manually).

0 0
replied on March 19, 2014

Also, if I remove just those items that have drop down lists from what gets populated by the Lookup Rule, the drop downs work normally.

0 0
replied on March 19, 2014 Show version history

The behavior you are describing is the current lookup behavior. If a lookup rule is supposed to populate some fields, those fields will only have the options provided by the results of the lookup rule. For Forms 9.2 we are planning to add a feature that will make lookup rules select the appropriate choice from a lookup rule, but still allow users to select a choice if the lookup does not find a match.

 

Until then, you can workaround this issue with some hidden fields and JavaScript. If you're interested in that method, I can try to point you in the right direction and get you started with some code.

0 0
replied on March 20, 2014 Show version history

To handle this with JavaScript

  1. Create a few single line fields that the lookup will populate with values for race, gender, day, etc.
  2. In the Advanced tab, next to CSS class give each field appropriate classes (race class for Race field, gender class for Gender field, day class for Day field. Because each of these fields will be hidden, give each of these fields the stealth class. (You can add multiple classes by adding a space between each class name in the CSS class setting.)
  3. Create the drop-down fields, ensure that each has choices that correspond to the values in your database table. Give each dropdown the appropriate css class (race, gender, day), as well as the visible class.
  4. On the Lookup Rules page, create your lookup rule and fill the single line fields (not the drop-downs) with the appropriate database values.

 

 

Then, on the CSS and JavaScript page, in the CSS section, add the following line:

.stealth {display: none;}

In the JavaScript section, add:

$(document).ready(function () {

    $('.day input').change(function () {
        $('.day.visible').find('option[value="' + $(this).val() + '"]').prop('selected', true)
    });

    $('.gender input').change(function () {
        $('.gender.visible').find('option[value="' + $(this).val() + '"]').prop('selected', true)
    });
    $('.race input').change(function () {
        $('.race.visible').find('option[value="' + $(this).val() + '"]').prop('selected', true)
    });
});

You could also do something cool like make the drop-down fields read-only if they get a value from the lookup.

2 0
replied on March 20, 2014

Thanks Eric!

0 0
replied on March 20, 2014

You're welcome!

0 0
replied on November 24, 2016 Show version history

Hi Eric,

Was this issue ever addressed? I'm using 10.1 Update 2 and am having the same issue. Is there a tick box I've not noticed? (not being sarcastic here)

-Ben

0 0
replied on November 28, 2016

Ben, see this post - there is a plan to fix this behavior, until then you can use a workaround.

https://answers.laserfiche.com/questions/100142/DB-Lookup-makes-DropDown-values-disappear#107892

1 0
replied on January 12, 2017

Append choices to lookup result for drop-down is now supported in Forms 10.2:

3 0
replied on January 13, 2017

Nice one, Laserfiche team :)

0 0
replied on January 31, 2017

Great, thank you and the team! Do we have a date when Forms 10.2 will be released? I don't see it in the downloads.

0 0
replied on January 31, 2017

Did you see that Forms 10.2 is part of the main Avante and Rio distributions?

1 0
replied on February 1, 2017

No, I didn't - thanks!

0 0
replied on July 17, 2017

Having some issues with this new feature. 

In my form, I am recalling a value from the database. Only the data retrieved in shown in the drop down list. 

When I engage this feature, the value is no longer retrieved from the database. Instead, only the options configured in Forms are available. 

Thoughts? What am I doing wrong?

 

0 0
replied on February 23, 2018

Hey Doug,

 

Did you ever get an answer to this?  We just updated a customer and are seeing a similar issue.

0 0
replied on February 23, 2018

Which version are you running?

0 0
replied on March 5, 2018

No response. Figured it out myself. Had to convert the drop down to a drop down within a table and it worked. Used CSS to hide all table elements so it just looks like a drop down - definitely not ideal. 

0 0
replied on March 6, 2018

Doug try the same scenario on a freshly created form and see if you run into the same issue. I had some odd issues like that on 10.1

0 0
replied on October 14, 2015

Is this still an issue? Looks like Eric mentioned that it might be resolved in Forms 9.2, but I'm still seeing the same behavior. That is, after a drop-down field is populated via a lookup, it wipes out all other drop-down options, leaving only the lookup value.

It would be awesome to get this behavior changed, as having to handle each drop-down field via JavaScript (as Eric mentions above) is a good bit of extra work. Thanks!

0 0
replied on April 12, 2016

We are running Forms 9.2 and came here because we are experiencing the same behavior.  This does appear to still be an issue.

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

Sign in to reply to this post.