Add field to form page list

Now I fully understand your situation!

When you create a _Lookup type, Five will take the first logical field in the referenced form and display this in your lookup. For you it is taking the First Name field.

Here are my members, inclusive of first name and last name.

In my lookup only the first name is listed when I come to my Membership form and go to select a member.

To have the First Name and the Last Name fields both displayed, you will need to change your display type to a _LookupQuery and write a small amount of SQL to concat these fields together. When you are writing your query please ensure to use the values in the ID fields on the Table form, for example, Data Source ID and Field ID.

  1. Select Data in the menu.

  2. Select Queries in the sub-menu.

  1. Click the Add Item button.

  2. Type an ID in the Data Source ID field.

  3. Click in the Query field to open Five’s Query Builder.

  1. Click the SQL tab.

  1. Type in your query. I have added an example below.

Note: When you add a _LookupQuery, at a minimum you need a primary key field and a value field, Five will hide the primary key field in your application.

SELECT
MemberKey,
CONCAT(FirstName, ’ ’ , LastName) AS Name
FROM
Member

Tip: You can click the Run button here to check your results.

  1. Click the Save button in the editor.

  1. Click the Save button in the form app bar.

  1. Navigate to your form record in the Forms view.

  2. Navigate to your field record that you want the First Name and Last Name to be displayed. (Same steps as previous for the Include in List switch)

  3. Click the lookup icon in the Display Type field and select _LookupQuery.

  4. Click the Cancel button in the Reference Form field.

  5. Click the lookup icon in the Lookup Query field and select the name of your query. (If you only have one, Five will populate it for you.)

  1. Click the Save buttons in the form app bar and run your app again.

  2. Navigate to your form and you will have both names in the dropdown.

Just for your knowledge, the reason we allow more than one field in the list is these will become the fields in the list. So if you look at the above image, the Memberships form has Member and Member No included in the list so they are visible on the left where the list of records will be displayed.

I hope this helps you.