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

Question

Question

DB Look-Up to Pre-Populate Drop Down - Loss Other Drop Down Options

asked on December 20, 2016

Hi there,

I have a form where I am using a db look-up to retrieve a list item for a drop down menu. However, when I do this, I lose all the other options that I have loaded into Forms for that drop down. 

1) Here is a picture of the information loaded from the db look-up

2) Here is what happens when I extend the drop down. 

3) Here is a list of all the options that I would like to see made available. 

 

What would I need to do to get this functionality.


Thanks!

 

0 0

Answer

SELECTED ANSWER
replied on January 12, 2017

This issue has been resolved with Forms 10.2, you now have an option called "Append choices to lookup results" for Drop-down field, when that is checked, the choices you configured will be kept when the Drop-down is populated by lookup.

2 0

Replies

replied on December 20, 2016

Hi Doug,

When using a lookup to populate a drop down it will disregard the options in the list from Forms.  The only way to have all of the options would be to add the options to that lookup or put all of the options into the drop down config.

~Dylan Mathiesen

2 0
replied on July 24, 2017

Dylan,


I'm still not think this is working correctly for us. 

I've gone a head and moved the drop down selections to populate directly from a database table. 

When I do a lookup based on a previous form submission, all of the results are removed expect for the value that is supposed to be recalled.

I need a solution that will allow me to recall the information via lookup but still allow the original list to be available should the user decide to change their answer.

Thanks in advance

1 0
replied on July 25, 2017 Show version history

Dylan,

Just following with details in the image below.

0 0
replied on August 11, 2017 Show version history

Hi Doug, from the screenshots you provided, the "20,000" is returned from lookup and your append values also contain that option, but it remove the one you listed in the append options when compose the list for the drop down. Want you want is when there are duplication among the lookup result and the choices configured, both of them will be kept? 

1 0
replied on August 11, 2017

Hi Xiuhong,

Good question. You're right we want the duplication but most importantly I'd like the returned lookup to be selected from the drop down menu.

We'd like to have the "20,000" returned from the lookup and selected from the drop-down menu.

Then I'd like to open the drop-down menu and see all the other options appended.

0 0
replied on August 14, 2017

Hi Doug,

     You request is same as Pieter's. And this feature request has already been added to our to do list. 

1 0
replied on August 15, 2017 Show version history

For drop-down, you can click the number in front of the choice to mark it as default value. So if "20,000" is always the returned value from lookup, you can click the number in front of it to mark it as default value so it will be selected by default always.

0 0
replied on December 20, 2016

Keep the choices configured after lookup returned result is supported with the coming Forms 10.2.

2 0
replied on January 5, 2017

Hi,

You know when Forms 10.2 is coming?  I am having lot of issues with lookup too.

 

Thanks!
AJ

0 0
replied on January 6, 2017

Forms 10.2 is targeted for release by the end of this month and prior to Empower 2017.

0 0
replied on January 12, 2017

I see that 10.2 is out. Can you confirm that this issue has been resolved?

0 0
SELECTED ANSWER
replied on January 12, 2017

This issue has been resolved with Forms 10.2, you now have an option called "Append choices to lookup results" for Drop-down field, when that is checked, the choices you configured will be kept when the Drop-down is populated by lookup.

2 0
replied on May 1, 2017

I'm still having issues with this...when I select "Append Choices to lookup results" the lookup rule no longer populates the field - it comes through blank.  When I unselect "Append choices to lookup results" it fills correctly as expected but my drop down is no long my whole list, rather just my prefilled choice.

0 0
replied on June 5, 2017

Hi Xiuhong-

I'd like to get some feedback on Amanda's point. When using the 'append values' option, it will not pre-fill the list from the lookup since there are multiple values. Is there any way to retain multiple values but still have the lookup automatically select the matching result?

As it stands now, append values retains the list but does not select a value upon lookup match (which is frustrating), and not appending values goes back to the original behavior of matching the lookup but wiping out all the other options (which is also frustrating).

Basically, I'd like a way to match the lookup value while retaining the complete list, without having to resort to JavaScript. The JS method can get a bit tricky to maintain, especially when there are numerous lookup lists on a single form.

1 0
replied on June 11, 2017

Hi Pieter, we understand the situation and will see whether there is way to auto selected the one from lookup with append choice is selected.

0 0
replied on August 11, 2017

Is there any update on this? I have some projects going on that will be a lot easier if the lookup can select in addition to 'append'.

2 0
replied on August 28, 2017

I ran into this exact issue today as well - we have a drop-down that is filled by a lookup, but client also wants users to be able to select a different value than the one returned by the lookup in certain circumstances. Is there any workaround for this?

1 0
replied on September 15, 2017

Bump - Is there an update on this item?

1 0
replied on December 1, 2017

@████████ You mentioned a JS method to fix this problem - any clues/examples as to what that would look like?

 

It looks like it won't be fixed this year and we're thinking we'll just have to fix this on our own.

0 0
replied on December 1, 2017

Hi Tom-

The workaround is to use two fields: a text field and the list field. Hide the text field via field rule and populate it with a lookup.

Then use JavaScript to copy the looked up value in the text field to the list field. You'll trigger it on the lookup running. Something like

$('.TextFieldClass input').on('change lookup', function(){
  $('.ListFieldClass select').val($(this).val());
});

If this is within a table, it's a little trickier to identify the lookup event and you'll need to only update the list on the specific row.

3 0
replied on December 1, 2017 Show version history

A similar workaround is needed for populating radio buttons and check-boxes. Hopefully, this will be addressed at some point.

0 0
replied on January 30, 2018

@Pieter Nauta are you able to show in Tom's example how this could be done within a table?

0 0
replied on August 14, 2020

Has anybody been able to do this within a table?

0 0
replied on August 18, 2020 Show version history

Here's a way to do it via JavaScript.

Setup:

  • Table with a class of MyTable
  • List field with a class of ListField  It will contain all of the values
  • Textbox with a class of TextField

 

The lookup populates TextField and then you'll copy that value into the list. The text field itself would be hidden on the final form, though I like to see it when testing. You don't need the final .change() but I generally include it for situations where there are field rules or other logic to trigger when setting the list.

$('.MyTable').on('change lookup', '.TextField', function(){
		var fieldValue = $(this).find('input[type="text"]').val();
		$(this).closest('tr').find('.ListField select').val(fieldValue);
		$(this).closest('tr').find('.ListField select').change();
	});

 

Doug, I apologize that I made you wait 2.5 years. I was surprised to see a thread pop up with me tagged in it. Different company and login now, but still a part of the Laserverse.

1 0
replied on August 20, 2020

welcome back!

0 0
replied on May 25, 2018

Is this function already released? my client has version 10.2.1.246 

0 0
replied on May 25, 2018

Hello Carlos, please take a look at Xiuhong's answer here.

0 0
replied on May 25, 2018

Without option "Append choices to lookup results"

Values returned from the lookup , but dont display another options

With  option "Append choices to lookup results"

there is no option preselected with lookup values returned.

 

This is in my test Virtual Machine with Forms 10.3 

Thank you for your response

0 0
replied on May 28, 2018

Hello Carlos,

It's difficult for me to tell how your lookup table is configured from your images, so I would suggest joining a Consultation Forum Webinar so one of our Presales team can take a look.

I've included some screenshots below that illustrate my testing and results:

Here's the table I created for the lookup:

As you can see in the attached "Append Unchecked" image, I have my hardcoded options configured, append choices unchecked, and no default value selected. The result of this is that there is no default value for the drop-down, and only the lookup values appear.

In the "Append Checked" image, the result is that there is no default value for the drop-down, and hardcoded options are appended to the list of lookup values that are populated.

The behaviour changes slightly if the lookup is dependent on another field's value, but I didn't run into any unexpected behaviour in the form or lookup.

Best,

Adam

Append Checked.JPG
Append Unchecked.JPG
0 0
replied on May 29, 2018 Show version history

Hi Adam, thanks for your response; my question was mainly focused on keeping an option on the list shortlisted.
That is, in a first form the client selects an option from the following list:


Single
Married
Widower


The first time select single.
After a while the client returns to update their data and through searches in a database all the fields with the information of the first form are pre-filled.


Now the client has married and must change the option of the list to married.
But the list must show all the options and keep at the same time preselected the value previously entered.
With forms there are 2 scenarios


Set a search rule to pre-populate the value with the result of the search in the database, but the list dissapear.
Select the "Append Choices to lookup Results" checkbox, the list is showed but no option is preselected.


So there is no real solution to this need that from what I have read is very common.


What we have had to do is a workaround using two fields and whith JS copy the value of the result of the search to the field that contains the list.

0 0
replied on May 29, 2018

Thank you for the clarification, Carlos. I didn't get that from your earlier post but I can see the use case for such a feature.

Currently, JS would have to be used to get this type of functionality, but I will bring it up to the Forms development team for consideration in a future release.

 

Cheers,

Adam

2 0
replied on January 8, 2023

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

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

Sign in to reply to this post.