Output Fields

From 3B Knowledge
Jump to navigation Jump to search

Overview

Form Fields are declarative output field definitions used throughout the WFM platform to display formatted field values. These definitions inform the application how to extract, format, and optionally link to data within various views such as:

  • shiftTitle
  • invitationTitle
  • contactTitle

They are especially useful when rendering summary cards, lists, or header titles in UIs such as shift invitations, contact records, and mobile components.

Field Definition Structure

Each output field definition is an object with the following attributes:

{
  "label": "Your Name",
  "fieldPath": "b3s__Contact__r.Name",
  "targetRecordIdPath": "b3s__Contact__r.Id",
  "formatter": "string",
  "hideIfNull": false
}

Field Definition Properties

Property Type Required Description
label string Optional The label shown next to the value. Used in label-value pairs or summary displays.
fieldPath string ✅ Yes A relative path from the current context object to the field whose value should be displayed. May support nested relationships via dot notation.
targetRecordIdPath string Optional If provided, makes the rendered value clickable. Clicking navigates to the referenced record. Common in Matching Engine outputs.
formatter string ✅ Yes Controls how the value should be formatted. See Formatters below.
siteTimezoneFieldPath string Optional Introduced in v4.0. Provides a path to the timezone context, used in conjunction with date/time formatters.
hideIfNull boolean ✅ Yes If true and the field has no value, the field is hidden entirely. If false and the value is null, "N/A" will be displayed.

Formatters

The formatter attribute defines how the raw field value(s) should be transformed for display.

Formatter Description
string Displays the field as plain text.
date Formats a date (e.g., 2025-08-02).
time Formats a time (e.g., 14:30 or 2:30 PM, depending on config).
dateTime Formats a date and time together (e.g., 2025-08-02 14:30).
startEnd (v4.0+) Requires a colon-separated fieldPath of two datetime fields. Formats time as HH:mm - HH:mm.
startEndWithDate (v4.0+) Same input as startEnd, but includes date from the start datetime: yyyy-mm-dd HH:mm - HH:mm.

Important: For startEnd and startEndWithDate, the fieldPath must include two datetime fields separated by a colon (:), e.g. "fieldPath": "Start__c:End__c"

Timezone Context (siteTimezoneFieldPath)

Introduced in v4.0, siteTimezoneFieldPath allows precise timezone control during formatting. It supports the following formatters:

  • time
  • date
  • dateTime
  • startEnd
  • startEndWithDate

If defined, the formatter will apply the specified timezone when rendering the datetime fields.

Child Related Objects (Related Lists)

As of v4.0, we support related (child) object rendering in all applications. These are useful for displaying 1-level deep related lists—like Breaks associated with a Shift.

{
  "label": "Breaks",
  "type": "break",
  "childObjectName": "b3s__Break__c",
  "childField": "b3s__Shift__c",
  "parentFieldPath": "Id",
  "title": [
    {
      "label": "Break Times",
      "fieldPath": "b3s__Start__c:b3s__End__c",
      "formatter": "startEnd",
      "siteTimezoneFieldPath": "b3s__Shift__r.b3s__Site__r.b3s__Site_Timezone__c",
      "hideIfNull": false
    },
    {
      "label": "Comments",
      "fieldPath": "b3s__Comments__c",
      "formatter": "string",
      "hideIfNull": true
    }
  ]
}

Related List Properties

Property Description
label Title shown above the related list.
type Required unique identifier. Not shown in UI.
childObjectName API name of the child object (e.g., b3s__Break__c).
childField Field on the child that links to the parent.
parentFieldPath Field on the parent used to match against childField. Usually Id.
title Array of field definitions (same structure as standard field definitions).

Important: You must also define a schedulable config for the new related object type:

"break": {
  "objectType": "b3s__Break__c"
}

Examples

{
  "label": "Your Name",
  "fieldPath": "b3s__Contact__r.Name",
  "targetRecordIdPath": "b3s__Contact__r.Id",
  "formatter": "string",
  "hideIfNull": false
}
{
  "label": "Shift Times",
  "fieldPath": "b3s__Shift__r.b3s__Scheduled_Start_Time__c:b3s__Shift__r.b3s__Scheduled_End_Time__c",
  "formatter": "startEnd",
  "siteTimezoneFieldPath": "b3s__Shift__r.b3s__Site__r.b3s__Site_Timezone__c",
  "hideIfNull": false
}
{
  "label": "Shift Times With Date",
  "fieldPath": "b3s__Shift__r.b3s__Scheduled_Start_Time__c:b3s__Shift__r.b3s__Scheduled_End_Time__c",
  "formatter": "startEndWithDate",
  "siteTimezoneFieldPath": "b3s__Shift__r.b3s__Site__r.b3s__Site_Timezone__c",
  "hideIfNull": false
}
{
  "label": "Date Invited",
  "fieldPath": "CreatedDate",
  "formatter": "dateTime",
  "hideIfNull": false
}

Limitations

  • Related lists are limited to one level of nesting. You cannot nest related lists inside another related list.
  • Colon-separated fieldPaths are only applicable to time ranges and must be used with compatible formatters (startEnd, startEndWithDate).