Skip to main content

Show a Field

Last updated 31/01/2022

How to Set a Field to Not Show

This documentation will explain how to only show form fields when it suits your requirements. The Show If field gives you the option to choose if you want to show a field on your form or not.

By writing a condition in JavaScript® you can choose not to show the field or only show the field when it suits your requirements. The condition can be as simple as:

  • true to show the field, or
  • false to not show the field

Default

true

With the default set as true the form field will show on the form.

Steps to Not Show a Field

  1. Select Forms in the menu.

  2. Select the required Form Record in the list.

  3. Click the Pages tab.


Select the Form Record
Figure 1 - Select the Form record

  1. Select the required Form Page record.

Select the Form Page Record
Figure 2 - Select the Form Page record

  1. Click the Fields tab.

Fields Tab
Figure 3 - Fields tab

  1. Select the required Form Field record.

Select the Form Field Record
Figure 4 - Select the Form Field record

  1. Either click the Edit button in the form app bar or click directly in the Show If field.

  2. Type false in the Show If field.

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


Make a Field False to Not Show
Figure 5 - Make a field false to not show

  1. Click both Save buttons in the stacked form app bars.

Save the Form
Figure 6 - Save the form


info

A condition can be added to the Show If field on the creation of the form.


Show a Field When Another Field has Data entered

To show a field after another field has an entry made will require conditional logic.

Example

In the Production application, we have a Quotes form with the fields Acceptance Code and Agreed Price. As an example, we can make the Acceptance Code field to show if a price has been agreed upon and the value has been entered in the Agreed Price field. You can write a condition using Five's API and specify that if the Agreed Price field has a value entered then show the Acceptance Code field.

Steps

  1. Select Forms in the menu.

  2. Select the required Form record in the list. For this example, the Quotes record.

  3. Click the Pages tab.


Select the Form Record
Figure 7 - Select the Form record

  1. Select the required Form Page. For this example, the General record.

Select the Form Page record
Figure 8 - Select the Form Page record

  1. Click the Fields tab.

Fields Tab
Figure 9 - Fields tab

  1. Select the required Form Field record, for this example, the Acceptance Code record.

Select the Form Field Record
Figure 9 - Select the Form Field record

  1. Either click the Edit button in the form app bar or click directly in the Show If field.

  2. Type your condition in the Show If field. For this example,

(form.AgreedPrice !== '' && form.AgreedPrice !== null)

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

Show If Field
Figure 10 - Show If field


info

The condition is stating that if the AgreedPrice field contains an empty string or is null than the Acceptance Code field will not show. To add this condition you will need to use form.FieldID.


  1. Click the Save button in both of the stacked form app bars above the list.

Save the Form
Figure 11 - Save the Form

How This Will Look in Your Application

In your end-user application the Acceptance Code will not show until there has been a value entered in the Agreed Price field.


Show If Field in an Application
Figure 11 - Show If field in an application


info

The value in the Acceptance Code field is removed upon saving as this field has been configured to be a non-database field.