Create

Create Custom Field

POST - /v2/companies/<company_id>/custom-fields

Required Properties

PropertyData TypeDescription
nameStringThe name of the Custom Field that will appear in the UI and dictate what the integration property name for the field becomes.
The name can not match any other names of Custom Fields already on the same entity (Projects or People).
typeStringThe type of Custom Field this will be. The type cannot be changed once a field is created.

Valid options are: text, number, currency, hex-color, bool, select, multi-select, date, paragraph.

Type details are explained below.

Optional Properties

PropertyData TypeDescription
can_filterBooleanIf set to true, it will allow this field to be used as a filter throughout the LaborChart application. Default: false
integration_onlyBooleanIf set to true, it will prevent users from editing this field, only allowing changes to come from your integration. Default: false
on_projectsBooleanControls whether this field is available to Projects. Default: false
on_peopleBooleanControls whether this field is available to People. Default: false
descriptionStringA description of what this field is used for. Helpful for Admin users understanding impacts of the field when in settings.
valuesArray of StringsOnly available to type: select or multi-select fields. This is a list of the values that you would like to be options in that field's drop down.
sort_byStringOnly available to type: select or multi-select fields. This controls how the options in a field's drop down are listed.

Valid options are: alpha, listed

If you select listed for this property, this options will be in the order you provide them in.

Default: alpha

Custom Field Types

To understand the different field types you can create, read through the below breakdown.

Text

The text field will create a single line input in the UI that accepts any String value.

672

Number

The number field will create a single line input in the UI that accepts any numeric value.

674

Currency

The currency field will create a single line input that accepts any numeric value and is visually distinct in the UI from the standard number field.

264

Hex-Color

The hex-color field accepts hex values as Strings with the format #53A9FF. This field has a UI component that presents users with a color picker for editing the field. The color field cannot be used as a filter.

246 686

Bool

The bool field creates a checkbox in the UI that accepts a Boolean value.

254

Select

The select field provides a drop-down in the UI that is populated with the values you set as options for the field. From the API, this field accepts a String representing one of your option values.

672

Multi-Select

The multi-select field provides a drop-down where multiple options can be selected. This field takes in an Array of Strings that represent values from the field's options.

674

Date

The date field presents a date selector in this UI.

This field can accept values in the following formats:

  • ISO: Mon Nov 04 2019 12:12:36 GMT-0600 (Central Standard Time)
  • Epoch MS Timestamp: 1572891249184
  • Date String: "11/4/19"

Dates for this field will be returned in requests as a date string "11/4/19".

458

Paragraph

The paragraph field will present a multi-line text area in the UI. This field does not have a character limit on it and it may not be used as a filter.

678

Full POST Body Ex.

{
  "name": "Location",
  "type": "select",
  "can_filter": true,
  "integration_only": false,
  "on_projects": true,
  "on_people": true,
  "description": "This field helps us filter down to different offices within our region groups",
   // Only need the below due to it being a type: "select".
  "values": ["Chicago", "Iowa", "Kansas City"],
  "sort_by": "alpha"
}

Responses:

Successful Response

When a new Custom Field has been successfully added to your LaborChart account, you will be returned the UUID representing the new Custom Field as confirmation.

{"id": "3f447732-33ec-4b8e-a5d0-6462c12e18e6"}