Planhat Logo

Developers

Planhat Logo

Developers

Custom Field

Most objects in Planhat can be customized by creating your own custom fields. Which model a given custom field belongs to is indicated by the parent property.

Typically you would create the custom fields from within the Planhat app. But in some special cases you may find it more convenient to manage over API instead.

Property
Required
Type
Description

_id



objectId

Planhat identifier.

name

Yes

string

Name of the custom field.

type

Yes

string

Type of the custom field, it should be one of: number, text, rich text, checkbox, day, date, list, multipicklist, team member, team members, rating, phone, email, enduser, endusers, url.

parent

Yes

string

Parent phModel.

isFeatured



boolean

If true the custom field will appear in the parent's detail view. Default as false.

isHidden

Yes

boolean

If true the custom field will not appear in any parent's view. Default as false.

isShared



boolean

If true the custom field will be shareable on portal. Default as false.

isLocked



boolean

If true the custom field will not be editable on the UI. Default as false.

isMandatory



boolean

If true the custom field will be required to create the parent's model. Default as false.

isFormula



boolean

True if the custom field is a formula field. Default as false.

treatUndefinedAsZero



boolean

If the custom field is a formula field, this will determine if a formula result null/undefined is replaced by zero. This is useful for custom fields type number.

formula



string

Formula definition.

listValues



array

Array of options for list and multipick custom types.

filter



array

Array of parts (objects) of the filter. (Autogenerated).

formulaRefs



array

Array of strings of the formula field references. (Autogenerated).

numberFormat



string

Custom number format, this is only valid for number types.

Most objects in Planhat can be customized by creating your own custom fields. Which model a given custom field belongs to is indicated by the parent property.

Typically you would create the custom fields from within the Planhat app. But in some special cases you may find it more convenient to manage over API instead.

Property
Required
Type
Description

_id



objectId

Planhat identifier.

name

Yes

string

Name of the custom field.

type

Yes

string

Type of the custom field, it should be one of: number, text, rich text, checkbox, day, date, list, multipicklist, team member, team members, rating, phone, email, enduser, endusers, url.

parent

Yes

string

Parent phModel.

isFeatured



boolean

If true the custom field will appear in the parent's detail view. Default as false.

isHidden

Yes

boolean

If true the custom field will not appear in any parent's view. Default as false.

isShared



boolean

If true the custom field will be shareable on portal. Default as false.

isLocked



boolean

If true the custom field will not be editable on the UI. Default as false.

isMandatory



boolean

If true the custom field will be required to create the parent's model. Default as false.

isFormula



boolean

True if the custom field is a formula field. Default as false.

treatUndefinedAsZero



boolean

If the custom field is a formula field, this will determine if a formula result null/undefined is replaced by zero. This is useful for custom fields type number.

formula



string

Formula definition.

listValues



array

Array of options for list and multipick custom types.

filter



array

Array of parts (objects) of the filter. (Autogenerated).

formulaRefs



array

Array of strings of the formula field references. (Autogenerated).

numberFormat



string

Custom number format, this is only valid for number types.

Most objects in Planhat can be customized by creating your own custom fields. Which model a given custom field belongs to is indicated by the parent property.

Typically you would create the custom fields from within the Planhat app. But in some special cases you may find it more convenient to manage over API instead.

Property
Required
Type
Description

_id



objectId

Planhat identifier.

name

Yes

string

Name of the custom field.

type

Yes

string

Type of the custom field, it should be one of: number, text, rich text, checkbox, day, date, list, multipicklist, team member, team members, rating, phone, email, enduser, endusers, url.

parent

Yes

string

Parent phModel.

isFeatured



boolean

If true the custom field will appear in the parent's detail view. Default as false.

isHidden

Yes

boolean

If true the custom field will not appear in any parent's view. Default as false.

isShared



boolean

If true the custom field will be shareable on portal. Default as false.

isLocked



boolean

If true the custom field will not be editable on the UI. Default as false.

isMandatory



boolean

If true the custom field will be required to create the parent's model. Default as false.

isFormula



boolean

True if the custom field is a formula field. Default as false.

treatUndefinedAsZero



boolean

If the custom field is a formula field, this will determine if a formula result null/undefined is replaced by zero. This is useful for custom fields type number.

formula



string

Formula definition.

listValues



array

Array of options for list and multipick custom types.

filter



array

Array of parts (objects) of the filter. (Autogenerated).

formulaRefs



array

Array of strings of the formula field references. (Autogenerated).

numberFormat



string

Custom number format, this is only valid for number types.

Create custom_field

To create a custom field it's required to define a name, parent, and type.

Example Request

curl --location -g --request POST 'https://api.planhat.com/customfields' \
 --header 'Content-Type: application/json' \
 --header 'Authorization: Bearer {{apiToken}}' \
 --data-raw '{
  "parent": "company",
  "type": "number",
  "isFeatured": true,
  "isHidden": false,
  "name": "Number field",
  "isFormula": false,
  "isLocked": false
 }'


Example Response

'{
  "isFeatured": true,
  "isShared": false,
  "listValues": [],
  "filter": [],
  "formulaRefs": [],
  "isFormula": false,
  "_id": "61043ced0b92efb8a6339cd1",
  "parent": "company",
  "type": "number",
  "isHidden": false,
  "name": "Number field",
  "isLocked": false,
  "__v": 0
 }'
Create custom_field

To create a custom field it's required to define a name, parent, and type.

Example Request

curl --location -g --request POST 'https://api.planhat.com/customfields' \
 --header 'Content-Type: application/json' \
 --header 'Authorization: Bearer {{apiToken}}' \
 --data-raw '{
  "parent": "company",
  "type": "number",
  "isFeatured": true,
  "isHidden": false,
  "name": "Number field",
  "isFormula": false,
  "isLocked": false
 }'


Example Response

'{
  "isFeatured": true,
  "isShared": false,
  "listValues": [],
  "filter": [],
  "formulaRefs": [],
  "isFormula": false,
  "_id": "61043ced0b92efb8a6339cd1",
  "parent": "company",
  "type": "number",
  "isHidden": false,
  "name": "Number field",
  "isLocked": false,
  "__v": 0
 }'
Create custom_field

To create a custom field it's required to define a name, parent, and type.

Example Request

curl --location -g --request POST 'https://api.planhat.com/customfields' \
 --header 'Content-Type: application/json' \
 --header 'Authorization: Bearer {{apiToken}}' \
 --data-raw '{
  "parent": "company",
  "type": "number",
  "isFeatured": true,
  "isHidden": false,
  "name": "Number field",
  "isFormula": false,
  "isLocked": false
 }'


Example Response

'{
  "isFeatured": true,
  "isShared": false,
  "listValues": [],
  "filter": [],
  "formulaRefs": [],
  "isFormula": false,
  "_id": "61043ced0b92efb8a6339cd1",
  "parent": "company",
  "type": "number",
  "isHidden": false,
  "name": "Number field",
  "isLocked": false,
  "__v": 0
 }'
Update custom_field

To update a custom field it's required to pass the _id in the request URL as a parameter.

Example Request

curl --location -g --request PUT 'https://api.planhat.com/customfields/61043ced0b92efb8a6339cd1' \
 --header 'Content-Type: application/json' \
 --header 'Authorization: Bearer {{apiToken}}' \
 --data-raw '{
  "isFeatured": false,
  "isHidden": true
 }'


Example Response

'{
  "_id": "61043ced0b92efb8a6339cd1",
  "isFeatured": false,
  "isShared": false,
  "listValues": [],
  "filter": [],
  "formulaRefs": [],
  "isFormula": false,
  "parent": "company",
  "type": "number",
  "isHidden": true,
  "name": "Number field",
  "isLocked": false,
  "__v": 0
 }'
Update custom_field

To update a custom field it's required to pass the _id in the request URL as a parameter.

Example Request

curl --location -g --request PUT 'https://api.planhat.com/customfields/61043ced0b92efb8a6339cd1' \
 --header 'Content-Type: application/json' \
 --header 'Authorization: Bearer {{apiToken}}' \
 --data-raw '{
  "isFeatured": false,
  "isHidden": true
 }'


Example Response

'{
  "_id": "61043ced0b92efb8a6339cd1",
  "isFeatured": false,
  "isShared": false,
  "listValues": [],
  "filter": [],
  "formulaRefs": [],
  "isFormula": false,
  "parent": "company",
  "type": "number",
  "isHidden": true,
  "name": "Number field",
  "isLocked": false,
  "__v": 0
 }'
Update custom_field

To update a custom field it's required to pass the _id in the request URL as a parameter.

Example Request

curl --location -g --request PUT 'https://api.planhat.com/customfields/61043ced0b92efb8a6339cd1' \
 --header 'Content-Type: application/json' \
 --header 'Authorization: Bearer {{apiToken}}' \
 --data-raw '{
  "isFeatured": false,
  "isHidden": true
 }'


Example Response

'{
  "_id": "61043ced0b92efb8a6339cd1",
  "isFeatured": false,
  "isShared": false,
  "listValues": [],
  "filter": [],
  "formulaRefs": [],
  "isFormula": false,
  "parent": "company",
  "type": "number",
  "isHidden": true,
  "name": "Number field",
  "isLocked": false,
  "__v": 0
 }'
Get custom_fields by ID

To get a specific custom field it's required to pass the _id in the request URL as a parameter.

Example Request

curl --location -g --request GET 'https://api.planhat.com/customfields/5c94de4752e54d5ce538ae18' \
 --header 'Content-Type: application/json' \
 --header 'Authorization: Bearer {{apiToken}}'

Example Response

'{
  "_id": "5c94de4752e54d5ce538ae18",
  "isFeatured": true,
  "listValues": [],
  "parent": "invoice",
  "type": "text",
  "isHidden": false,
  "name": "PO Number"
 }'
Get custom_fields by ID

To get a specific custom field it's required to pass the _id in the request URL as a parameter.

Example Request

curl --location -g --request GET 'https://api.planhat.com/customfields/5c94de4752e54d5ce538ae18' \
 --header 'Content-Type: application/json' \
 --header 'Authorization: Bearer {{apiToken}}'

Example Response

'{
  "_id": "5c94de4752e54d5ce538ae18",
  "isFeatured": true,
  "listValues": [],
  "parent": "invoice",
  "type": "text",
  "isHidden": false,
  "name": "PO Number"
 }'
Get custom_fields by ID

To get a specific custom field it's required to pass the _id in the request URL as a parameter.

Example Request

curl --location -g --request GET 'https://api.planhat.com/customfields/5c94de4752e54d5ce538ae18' \
 --header 'Content-Type: application/json' \
 --header 'Authorization: Bearer {{apiToken}}'

Example Response

'{
  "_id": "5c94de4752e54d5ce538ae18",
  "isFeatured": true,
  "listValues": [],
  "parent": "invoice",
  "type": "text",
  "isHidden": false,
  "name": "PO Number"
 }'
Get custom_fields List

When fetching multiple custom fields there are some options that can be used via query params:

  • limit: Limit the list length. Default as 100, max. 2000.

  • offset: Start the list on a specific integer index.

  • sort: Sort based on a specific property. Prefix the property "-" to change the sort order.

  • select: Select specific properties. Multiple properties can be specified separating them by commas.

Example Request

curl --location -g --request GET 'https://api.planhat.com/customfields?limit=2&offset=0' \
 --header 'Content-Type: application/json' \
 --header 'Authorization: Bearer {{apiToken}}'

Example Response

'[
  {
  "_id": "5c8a24fdc923c77bf64dc567",
  "isFeatured": false,
  "listValues": [],
  "parent": "company",
  "type": "number",
  "isHidden": false,
  "name": "Hours Invested",
  "isShared": false,
  "filter": [],
  "sortOrder": 9,
  "isLocked": false
  },
  {
  "_id": "5c94de4752e54d5ce538ae18",
  "isFeatured": true,
  "listValues": [],
  "parent": "invoice",
  "type": "text",
  "isHidden": false,
  "name": "PO Number"
  }
 ]

Get custom_fields List

When fetching multiple custom fields there are some options that can be used via query params:

  • limit: Limit the list length. Default as 100, max. 2000.

  • offset: Start the list on a specific integer index.

  • sort: Sort based on a specific property. Prefix the property "-" to change the sort order.

  • select: Select specific properties. Multiple properties can be specified separating them by commas.

Example Request

curl --location -g --request GET 'https://api.planhat.com/customfields?limit=2&offset=0' \
 --header 'Content-Type: application/json' \
 --header 'Authorization: Bearer {{apiToken}}'

Example Response

'[
  {
  "_id": "5c8a24fdc923c77bf64dc567",
  "isFeatured": false,
  "listValues": [],
  "parent": "company",
  "type": "number",
  "isHidden": false,
  "name": "Hours Invested",
  "isShared": false,
  "filter": [],
  "sortOrder": 9,
  "isLocked": false
  },
  {
  "_id": "5c94de4752e54d5ce538ae18",
  "isFeatured": true,
  "listValues": [],
  "parent": "invoice",
  "type": "text",
  "isHidden": false,
  "name": "PO Number"
  }
 ]

Get custom_fields List

When fetching multiple custom fields there are some options that can be used via query params:

  • limit: Limit the list length. Default as 100, max. 2000.

  • offset: Start the list on a specific integer index.

  • sort: Sort based on a specific property. Prefix the property "-" to change the sort order.

  • select: Select specific properties. Multiple properties can be specified separating them by commas.

Example Request

curl --location -g --request GET 'https://api.planhat.com/customfields?limit=2&offset=0' \
 --header 'Content-Type: application/json' \
 --header 'Authorization: Bearer {{apiToken}}'

Example Response

'[
  {
  "_id": "5c8a24fdc923c77bf64dc567",
  "isFeatured": false,
  "listValues": [],
  "parent": "company",
  "type": "number",
  "isHidden": false,
  "name": "Hours Invested",
  "isShared": false,
  "filter": [],
  "sortOrder": 9,
  "isLocked": false
  },
  {
  "_id": "5c94de4752e54d5ce538ae18",
  "isFeatured": true,
  "listValues": [],
  "parent": "invoice",
  "type": "text",
  "isHidden": false,
  "name": "PO Number"
  }
 ]

Delete custom_fields

To delete a custom field it's required to pass the _id in the request URL as a parameter.

Example Request

curl --location -g --request DELETE 'https://api.planhat.com/customfields/61043ced0b92efb8a6339cd1' \
 --header 'Content-Type: application/json' \
 --header 'Authorization: Bearer {{apiToken}}'

Example Response

'{
  "n": 1,
  "ok": 1,
  "deletedCount": 1
 }'
Delete custom_fields

To delete a custom field it's required to pass the _id in the request URL as a parameter.

Example Request

curl --location -g --request DELETE 'https://api.planhat.com/customfields/61043ced0b92efb8a6339cd1' \
 --header 'Content-Type: application/json' \
 --header 'Authorization: Bearer {{apiToken}}'

Example Response

'{
  "n": 1,
  "ok": 1,
  "deletedCount": 1
 }'
Delete custom_fields

To delete a custom field it's required to pass the _id in the request URL as a parameter.

Example Request

curl --location -g --request DELETE 'https://api.planhat.com/customfields/61043ced0b92efb8a6339cd1' \
 --header 'Content-Type: application/json' \
 --header 'Authorization: Bearer {{apiToken}}'

Example Response

'{
  "n": 1,
  "ok": 1,
  "deletedCount": 1
 }'