Configure Extra Form Fields
Use Extra Form Fields to add custom Salesforce fields to existing Employee Hub forms. Configure each field with flair__Extra_Form_Field__mdt without replacing the form's default field set.
Salesforce Admins who manage fields and the Flair Extra Form Field custom metadata type in Salesforce Setup. Employees see the fields in the Employee Hub.
Before you begin
- Create the custom field on the target Salesforce object.
- Record the object's API name and the field's API name.
- Identify the form ID if the field should appear in one form only.
Review supported forms
| Form | Form ID |
|---|---|
| Absence Request Form | flair__Absence__c.RequestAbsence |
| Absence Manager Details | flair__Absence__c.ManagerDetails |
| Expense Request Form | flair__Expense__c.RequestExpense |
| Expense Details | flair__Expense__c.Details |
| Expense Item Request Form | flair__Expense_Item__c.RequestExpenseItem |
| Project User Details | flair__Project__c.UserDetails |
| Project Manager Details | flair__Project__c.ManagerDetails |
| Projects Time Entry Edit | flair__Project_Time_Entry__c.Edit |
Supported Salesforce field types are Text Area, Long Text Area, Date, Time, DateTime, Picklist, Lookup Reference, and Number.
Create an Extra Form Field
- In Salesforce Setup, enter
Custom Metadata Typesin Quick Find. - Open Custom Metadata Types.
- Next to Flair Extra Form Field, click Manage Records.
- Click New.
- In Object API Name, enter the target object, such as
flair__Expense__corflair__Absence__c. - In Field API Name, enter the field to display, such as
flair__Amount__corflair__Description__c. - Configure any optional settings in Review Extra Form Field settings.
- Click Save.

Review Extra Form Field settings
| Setting | What it does |
|---|---|
| Object API Name | Identifies the Salesforce object. This setting is required. |
| Field API Name | Identifies the custom field to display. This setting is required. |
| Required | Makes the field required in the Employee Hub form even when Salesforce does not require it. |
| Active | Shows the field. Clear it to hide the field without deleting the metadata record. |
| Form Id | Limits the field to one form. Leave it empty to show the field in every supported form for the object. |
| Position | Sets the display order. Lower numbers appear first. |
| Visibility Condition | Stores the JSON condition that controls when the field appears. |
| Lookup SOQL Filter | Stores a SOQL WHERE clause that filters lookup options. |
| Visible Lines | Sets the number of visible lines for a multiline Text Area. |
Configure a visibility condition
Visibility conditions use JSON criteria similar to MongoDB query syntax. They can read form values, record types, or context parameters.
Show a field for one record type
Use the Record Type Name API name, not the label:
{
"$formValues.recordTypeName": "Travel_Expense"
}
Show a field for one absence category
{
"$contextParams.absenceCategoryName": "Sickness"
}
Hide a field for selected values
{
"$contextParams.absenceCategoryName": {"$ne": ["Sickness", "Home Leave"]}
}
Combine conditions
Use $or for either record type:
{
"$or": [
{ "$formValues.recordTypeName": "Travel_Expense" },
{ "$formValues.recordTypeName": "Default_Expense" }
]
}
Use $or and $and for nested logic:
{
"$or": [
{ "$formValues.recordTypeName": "Travel_Expense" },
{
"$and": [
{ "$contextParams.absenceCategoryName": { "$ne": ["Sickness", "Home Leave"] } },
{ "$formValues.recordTypeName": "Default_Expense" }
]
}
]
}
The condition supports these operators and keys:
| Operator or key | What it does |
|---|---|
$eq | Tests equality. This is the default when no operator is present. |
$ne | Tests inequality. |
$or | Passes when one nested condition passes. |
$and | Passes when every nested condition passes. |
$formValues.recordTypeName | Reads the Record Type Name API name. |
$contextParams.absenceCategoryName | Reads the absence category in the Absence Request Form. |
$contextParams.employeeAbsenceCategory | Reads the employee absence category in the Absence Request Form. |
$contextParams.day | Reads the day in Projects Time Entry Edit. |
$contextParams.project | Reads the project in Projects Time Entry Edit. |
$contextParams.employee | Reads the employee in Projects Time Entry Edit. |
Configure a lookup filter
For a Lookup Reference field, enter a SOQL WHERE clause in Lookup SOQL Filter.
Filter employees by manager
flair__Manager__c = :currentEmployee.Manager__c
Filter with a context parameter
Absence_Category__c = :contextParams.employeeAbsenceCategory.flair__Absence_Category__c
Filter with LIKE
flair__Manager__r.Name LIKE '%:currentEmployee.flair__First_Name__c%'
Combine lookup criteria
Ensurance_Number__c LIKE ':currentEmployee.Ensurance_Number__c%'
AND Some_Employee__c = :currentEmployee.flair__Manager__r.flair__Manager__c
Lookup filters support these dynamic parameters:
| Parameter | What it references |
|---|---|
:currentEmployee | The current employee record, such as :currentEmployee.flair__First_Name__c or :currentEmployee.Manager__c. |
:contextParams | Values passed to the form, such as :contextParams.employeeAbsenceCategory.flair__Absence_Category__c. |
Configure common field patterns
Show a medical certificate field for sickness
-
On
flair__Absence__c, createflair__Medical_Certificate_ID__c. -
Create an Extra Form Field with Object API Name set to
flair__Absence__c. -
Set Field API Name to
flair__Medical_Certificate_ID__c. -
Set Form Id to
flair__Absence__c.RequestAbsence. -
Enter this Visibility Condition:
{
"$contextParams.absenceCategoryName": "Sickness"
} -
Click Save.
Filter an expense allowance by employee
-
On
flair__Expense__c, create the lookup fieldflair__Expense_Allowance__c. -
Create an Extra Form Field with Object API Name set to
flair__Expense__c. -
Set Field API Name to
flair__Expense_Allowance__c. -
Enter this Lookup SOQL Filter:
flair__Employee__c = :currentEmployee.Id -
Click Save.
Show a field for travel expenses
-
On
flair__Expense__c, createflair__Flight_Number__c. -
Create an Extra Form Field with Object API Name set to
flair__Expense__c. -
Set Field API Name to
flair__Flight_Number__c. -
Enter this Visibility Condition:
{
"$formValues.recordTypeName": "Travel_Expense"
} -
Click Save.
Configure fields with inline JSON
Instead of custom metadata records, an object-level text field such as flair__Request_Form__c.flair__Extra_Fields_Config__c can store an array. Each item is a field API name or an object with field options.
Use an array of field names for a basic configuration:
["Name", "flair__Description__c"]
Add options to a field object:
["Name", {"flair__Description__c": {"visibleLines": 10}}]
Add a lookup filter:
["Name", {"Take_Over_Employee__c": {"lookupSOQLFilter": "flair__Manager__c = :currentEmployee.flair__Manager__c"}}]
Add a visibility condition:
["Name", {"flair__Usa_Notes__c": {"visibilityCondition": {"$formValues.recordTypeName": "Usa"}}}]
Inline JSON supports these options:
| Option | Type | What it does |
|---|---|---|
position | number | Sets the display order. |
required | boolean | Overrides the Salesforce required-field property. |
visibleLines | number | Sets the number of lines for multiline Text Areas. |
visibilityCondition | string or object | Sets a JSON visibility condition. |
lookupSOQLFilter | string | Sets a SOQL WHERE clause for a lookup. |
Advanced configurations also support fieldApiName, objectApiName, formId, and active.
Troubleshooting
A field does not appear
- Confirm that Active is selected.
- Confirm that Object API Name and Field API Name use API names, not labels.
- Confirm that the field exists on the Salesforce object.
- Validate the JSON in Visibility Condition.
- Confirm that Form Id matches the displayed form.
A lookup filter does not work
- Validate the SOQL syntax.
- Confirm that
:currentEmployeeand:contextParamsmatch the supported parameter names exactly. - Confirm that every referenced field exists.
- Test the SOQL query in Salesforce Developer Console.
A visibility condition does not work
- Validate the JSON syntax.
- Confirm that the record type value is the API name, not the label.
- Confirm that the selected form supplies the context parameter.
- Test one condition before adding nested logic.