Forms field to get look up value

Hi,
I want a form field in form_1 to get the value from dbfeild_name of a separate table. Works fine when it is used as select with grid lookup. Even when I say “Use lookup to display the field description”, it shows the value I want next to the field. But I want the looked up value inside the field to send it as an e-mail and to save to db.

So here is the scenario:
Table 1:
ID value
1 Apple
2 Orange

Form_1
Feild1 > Looked up to Table1 and got Table1.ID1, which is equal to a param value. I want to show Apple as the result.

Can someone help, please.

Re: Forms field to get look up value

  1. datatype select -> enter query in tab edition loopup
  2. datetype text -> enter query in tab grid lookup (after checking “Use lookup to display the field description”)
  3. using another application to select a value

What method are you using?

If you want a specific column value to show up in a poplist, then just select only that column in the select in edition lookup using option 1.

Re: Forms field to get look up value

  1. datetype text -> enter query in tab grid lookup (after checking “Use lookup to display the field description”)

This is what already done. The problem is the value is being showed next to the feild, not within the field. See the image attached.

The grid lookup is here:

Re: Forms field to get look up value

why don’s you use method 1? I think that is what you want.

Re: Forms field to get look up value

Not really. It is an e-mail form. If I don’t get the mode_name (ie. the looked up value), the mail will show just the ID.

Re: Forms field to get look up value

but you can use the exact same query with method 1 can’t you?

Re: Forms field to get look up value

I tried Select. But it just passes the label reference ID not the label value itself.
For example: I get id 1 for the entry Apple. Where I want Apple to come.

Re: Forms field to get look up value

In a single record form in V5.1, I’m sure it’s possible, I used this method on several occasions.

Below, on the left my settings, on the right in green you see (part of) the result. The status field shows value “BT3”, which is a value in column “waarde” of table “ref_codes”. This is what you want right?

Re: Forms field to get look up value

Actually not. The one you showed me is something I could achieve. Try sending the same form as an e-mail with sc_email script, it will take the id, not the looked-up value!

Re: Forms field to get look up value

I can extract the value (BT3) of field status and use it in whatever sc macro I want.

This has nothing to do with an “id” as long as you use field type “select”.

If this doesn’t work for you, contact support.

Re: Forms field to get look up value

Use sc_lookup() like this

$sql=“SELECT mode FROM mode WHERE…”;
sc_lookup(dataset,$sql);
{field1}={dataset}[0][0];

and put it into event that you need

Re: Forms field to get look up value

@Sztajer:
why use sc_lookup when the value you need is already available in de form?

Re: Forms field to get look up value

He was trying to use lookup to display field description but he want to display this value in input not next to input. There isn`t in form app a lookup to display field value so he need to write own lookup.

I had a similiar problem and this is works for me.