Currency Custom Field

Store a monetary amount and its currency on a record, with an optional default currency and min/max range.


A currency custom field stores a monetary amount together with a currency code (1500.50 + USD) on a record. It maps to the CURRENCY value of the CustomFieldType enum. Records are Record objects and custom fields are CustomField objects in the API.

The set of currencies a field offers is stored as CustomFieldOption rows on the field — one option per currency (USD, EUR, GBP, …), each identified by its three-letter code in title. The field’s currency property is the default code used when a value omits one.

Overview

Enum valueCURRENCY
Value fields on CustomFieldnumber (the amount), currency (the code)
Set with setRecordCustomFieldnumber, currency
Set with createRecorda single value string encoding amount + code

Create

Use the createCustomField mutation with type: CURRENCY. The field is created in the workspace identified by the blue-workspace-id header — there is no projectId argument. Set currency to the default code and, optionally, min/max to record an intended range.

mutation CreateCurrencyField {
  createCustomField(
    input: { name: "Deal Value", type: CURRENCY, currency: "USD", min: 0, max: 1000000 }
  ) {
    id
    name
    type
    currency
    min
    max
  }
}
{
  "data": {
    "createCustomField": {
      "id": "clm4n8qwx000008l0g4oxdqn7",
      "name": "Deal Value",
      "type": "CURRENCY",
      "currency": "USD",
      "min": 0,
      "max": 1000000
    }
  }
}

CreateCustomFieldInput

ParameterTypeRequiredDescription
nameString!YesDisplay name of the field.
typeCustomFieldType!YesMust be CURRENCY.
currencyStringNoDefault three-letter currency code used when a value is set without one.
minFloatNoLowest intended amount. Recorded on the field; not enforced when setting values.
maxFloatNoHighest intended amount. Recorded on the field; not enforced when setting values.
descriptionStringNoHelp text shown alongside the field.
prefixStringNoDisplay prefix shown before the amount.
Offer more than one currency

A new currency field offers only its default currency. To let records choose another code, add a CustomFieldOption per currency with createCustomFieldOptions — each option’s title is the three-letter code. When a value is set, the code is matched against these options.

Set a value

Use the setRecordCustomField mutation with number (the amount) and currency (the code). It returns Boolean! — there are no subfields to select.

mutation SetDealValue {
  setRecordCustomField(
    input: { todoId: "todo_123", customFieldId: "field_123", number: 1500.50, currency: "USD" }
  )
}
{ "data": { "setRecordCustomField": true } }

SetRecordCustomFieldInput

ParameterTypeRequiredDescription
todoIdString!YesThe record to update.
customFieldIdString!YesThe currency field to set.
numberFloatNoThe monetary amount.
currencyStringNoThree-letter currency code. Falls back to the field’s default currency when omitted.

Setting a value while creating a record

createRecord takes custom field values as CreateRecordInputCustomField entries, each with only customFieldId and a single value string — there is no separate currency key here. For a currency field, encode the amount and code into one string:

valueResult
"200USD"amount 200, currency USD
"USD200"amount 200, currency USD
"5000"amount 5000, currency = the field’s default

The code (when present) is matched against the field’s currency CustomFieldOption rows; an unrecognized code falls back to the field’s first option.

mutation CreateDeal {
  createRecord(
    input: {
      title: "Acme renewal"
      todoListId: "list_123"
      customFields: [{ customFieldId: "field_123", value: "25000.00GBP" }]
    }
  ) {
    id
    title
    customFields {
      name
      type
      number
      currency
    }
  }
}
{
  "data": {
    "createRecord": {
      "id": "clm4n8qwx000008l0g4oxdqn7",
      "title": "Acme renewal",
      "customFields": [
        { "name": "Deal Value", "type": "CURRENCY", "number": 25000, "currency": "GBP" }
      ]
    }
  }
}

Read a value

Read currency values from a record’s customFields connection. Each element is a CustomField — select number for the amount and currency for the code.

query ReadDealValue {
  recordQueries {
    todos(filter: { companyIds: ["company_123"], todoListIds: ["list_123"] }) {
      items {
        id
        title
        customFields {
          name
          type
          number
          currency
        }
      }
    }
  }
}
{
  "data": {
    "recordQueries": {
      "todos": {
        "items": [
          {
            "id": "clm4n8qwx000008l0g4oxdqn7",
            "title": "Acme renewal",
            "customFields": [
              { "name": "Deal Value", "type": "CURRENCY", "number": 25000, "currency": "GBP" }
            ]
          }
        ]
      }
    }
  }
}

Notes

  • Amount and code are separate columns. number holds the amount, currency holds the code. setRecordCustomField writes both directly; createRecord parses both out of the single value string.
  • min/max are not enforced. They are stored on the field as a documented range but are not validated when values are set or updated.
  • Conversion is a separate field type. A CURRENCY field does not convert between currencies. To convert a source amount into other currencies automatically, use a Currency Conversion field.

Errors

CodeWhen
CUSTOM_FIELD_NOT_FOUNDcustomFieldId does not resolve to a field in the workspace.
TODO_NOT_FOUNDtodoId does not resolve to a record you can access.
CUSTOM_FIELD_VALUE_PARSE_ERRORThe supplied amount cannot be parsed as a number.
BAD_USER_INPUTA required argument is missing or malformed.
FORBIDDENYou lack permission to edit the field on this record.