The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group

Slack Signup
Newsletter Optin
Help Desk

Auto Select Only Option In Lookup

Labels

This Discussion is public

Notifications

This will only work if the lookup field is of type Single Line Text.

Either, or both the created fields, can be set to visibility "Administrator" so as to not be seen by your end user.

Create an ordinary Single Line Text field, and select "Dynamically retrieve the value from a Lookup field".  If need be, watch a lookup field.  There must be only one option retrieved for this to work (pretty obvious, but hey, thought I'd mention it anyways).

Create a Lookup field, and make it of type Single Line Text.  You can have it lookup the same field as your Single Text field is, or not doing a lookup, it doesn't matter either way.

Place the following piece of code in Settings=>Customize HTML=>Before Fields:

<script>
jQuery(document).ready(function($){
$('#field_SLT').change(function(){
var sourceField = $('#field_SLT').val();
$('#field_LSLT').val(sourceField);
$('#field_LSLT').trigger({ type:'change', originalEvent:'custom' });
});
});
</script>

Replace SLT with the field key of your Single Line Text field, and LSLT with the field key of your Lookup field.

And presto bingo, only option in the lookup field is auto selected.

Discussion closed.