Asana: Add a custom field to a table
Asana tables.addCustomFieldSettingForTable: arguments, response, policy and SDK examples.
← Tables operations · Get started
Operation asana.addcustomfieldsettingfortable
Provider route: POST /tables/{table_gid}/addCustomFieldSetting. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/asana with npm, or alter-sdk-asana with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { AsanaIntegration } from "@alter-ai/asana";
async function execute(input: Parameters<AsanaIntegration["tables"]["addCustomFieldSettingForTable"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new AsanaIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.tables.addCustomFieldSettingForTable(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_asana import AsanaIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = AsanaIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.tables.add_custom_field_setting_for_table(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.table_gid | string | Required within parent | |
query | object | Optional | Additional keys: not allowed |
query.opt_pretty | boolean | Optional | |
query.opt_fields | array | Optional | |
query.opt_fields[] | string | Each item | One of: custom_field, custom_field.date_value, custom_field.date_value.date, custom_field.date_value.date_time, custom_field.display_value, custom_field.enabled, custom_field.enum_options, custom_field.enum_options.color, custom_field.enum_options.enabled, custom_field.enum_options.name, custom_field.enum_value, custom_field.enum_value.color, custom_field.enum_value.enabled, custom_field.enum_value.name, custom_field.id_prefix, custom_field.input_restrictions, custom_field.is_formula_field, custom_field.is_lookup_field, custom_field.multi_enum_values, custom_field.multi_enum_values.color, custom_field.multi_enum_values.enabled, custom_field.multi_enum_values.name, custom_field.name, custom_field.number_value, custom_field.representation_type, custom_field.text_value, custom_field.type, is_important |
body | object | Required within parent | |
body.data | Model | Required within parent | Expand Add a custom field to a table — request body — body data |
Referenced models: Add a custom field to a table — request body — body data
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (allOf 1) | object | All variants apply | |
$ (allOf 1).data | Model | Optional | Expand Add a custom field to a table — response body — data data — Custom Field Table Setting Response |
$ (allOf 2) | Model | All variants apply | Expand Add a custom field to a table — response body — data |
Referenced models: Add a custom field to a table — response body — data data — Custom Field Table Setting Response, Add a custom field to a table — response body — data
Schemas
Section titled “Schemas”7 more schemas are linked from the tables above, on the schema pages.
Add a custom field to a table — request body — body data
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
custom_field | JSON | Required within parent | |
custom_field (oneOf 1) | string | Alternative | The custom field to associate with this container. |
custom_field (oneOf 2) | Model | Alternative | Expand Add a custom field to a table — request body — body / data / custom_field / format: currency, identifier, percentage, custom, duration, none, resource subtype: text, enum, multi enum, number, date, people, reference, type: text, enum, multi enum, number, date, people, reference |
is_important | boolean | Optional | Whether this field should be considered important to this container (for instance, to display in the list view of items in the container). |
insert_before | string | Optional | A gid of a Custom Field Setting on this container, before which the new Custom Field Setting will be added. `insert_before` and `insert_after` parameters cannot both be specified. |
insert_after | string | Optional | A gid of a Custom Field Setting on this container, after which the new Custom Field Setting will be added. `insert_before` and `insert_after` parameters cannot both be specified. |
Add a custom field to a table — response body — data data — Custom Field Table Setting Response
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (allOf 1) | Model | All variants apply | Expand Add a custom field to a table — response body — data data gid, resource type |
$ (allOf 2) | object | All variants apply | |
$ (allOf 2).custom_field | JSON | Optional | |
$ (allOf 2).custom_field (allOf 1) | Model | All variants apply | Expand Get a membership — response body — data / data / access_level: admin, editor, user parent |
$ (allOf 2).custom_field (allOf 2) | object | All variants apply | The custom field that is applied to the table. Read only: true |
$ (allOf 2).is_important | boolean | Optional | `is_important` is used in the Asana web application to determine if this custom field is displayed in the list/grid view of a table. Read only: true |
Referenced models: Add a custom field to a table — response body — data data gid, resource type, Get a membership — response body — data / data / access_level: admin, editor, user parent
Add a custom field to a table — response body — data
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
data | Model | Required within parent | Expand Add a custom field to a table — response body — data data — sdk__Custom Field Table Setting Response |
Referenced models: Add a custom field to a table — response body — data data — sdk__Custom Field Table Setting Response
Add a custom field to a table — request body — body / data / custom_field / format: currency, identifier, percentage, custom, duration, none, resource subtype: text, enum, multi enum, number, date, people, reference, type: text, enum, multi enum, number, date, people, reference
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (allOf 1) | Model | All variants apply | Expand Add a custom field to a table — request body — body / data / custom_field / format: currency, identifier, percentage, custom, duration, none, resource subtype: text, enum, multi enum, number, date, people, reference, type: text, enum, multi enum, number, date, people, reference format: currency, identifier, percentage, custom, duration, none, type: text, enum, multi enum, number, date, people, reference |
$ (allOf 2) | object | All variants apply | |
$ (allOf 2).resource_subtype | string | Required within parent | The type of the custom field. Must be one of the given values. One of: text, enum, multi_enum, number, date, people, reference |
Add a custom field to a table — response body — data data gid, resource type
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A *custom field table setting* represents the many-to-many join of a custom field and a table, storing information relevant to that particular pairing. |
gid | string | Optional | Globally unique identifier of the resource, as a string. Read only: true |
resource_type | string | Optional | The base type of this resource. Read only: true |
Add a custom field to a table — response body — data data — sdk__Custom Field Table Setting Response
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A generic Asana Resource, containing a globally unique identifier.A generic Asana Resource, containing a globally unique identifier. A *custom field table setting* represents the many-to-many join of a custom field and a table, storing information relevant to that particular pairing. |
gid | string | Optional | Globally unique identifier of the resource, as a string. Read only: true |
resource_type | string | Optional | The base type of this resource. Read only: true |
custom_field | Model | Optional | Expand Add a custom field to a table — response body — data data custom field |
is_important | boolean | Optional | `is_important` is used in the Asana web application to determine if this custom field is displayed in the list/grid view of a table. Read only: true |
Referenced models: Add a custom field to a table — response body — data data custom field
Add a custom field to a table — request body — body / data / custom_field / format: currency, identifier, percentage, custom, duration, none, resource subtype: text, enum, multi enum, number, date, people, reference, type: text, enum, multi enum, number, date, people, reference format: currency, identifier, percentage, custom, duration, none, type: text, enum, multi enum, number, date, people, reference
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (allOf 1) | Model | All variants apply | Expand Add a custom field to a table — request body — body / data / custom_field / format: currency, identifier, percentage, custom, duration, none, resource subtype: text, enum, multi enum, number, date, people, reference, type: text, enum, multi enum, number, date, people, reference format: currency, identifier, percentage, custom, duration, none, type: text, enum, multi enum, number, date, people, reference format: currency, identifier, percentage, custom, duration, none, type: text, enum, multi enum, number, date, people, reference |
$ (allOf 2) | object | All variants apply | |
$ (allOf 2).workspace | string | Required within parent | *Create-Only* The workspace to create a custom field in. |
$ (allOf 2).owned_by_app | boolean | Optional | *Allow-listed*. Instructs the API that this Custom Field is app-owned. This parameter is allow-listed to specific apps at this point in time. For apps that are not allow-listed, providing this parameter will result in a `403 Forbidden`. |
$ (allOf 2).people_value | array | Optional | *Conditional*. Only relevant for custom fields of type `people`. This array of user GIDs, emails, or the string "me", reflects the users to be written to a `people` custom field. Note that *write* operations will replace existing users (if any) in the custom field with the users specified in this array. |
$ (allOf 2).people_value[] | string | Each item | A string identifying a user. This can either be the string "me", an email, or the gid of a user. |
$ (allOf 2).reference_value | array | Optional | *Conditional*. Only relevant for custom fields of type `reference`. This array of GIDs reflects the objects to be written to a `reference` custom field. Note that *write* operations will replace existing objects (if any) in the custom field with the objects specified in this array. |
$ (allOf 2).reference_value[] | string | Each item | The GID of an object. |
Get a custom field — response body — data data date value date, date time
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | *Conditional*. Only relevant for custom fields of type `date`. This object reflects the chosen date (and optionally, time) value of a `date` custom field. If no date is selected, the value of `date_value` will be `null`. |
date | string | Optional | A string representing the date in YYYY-MM-DD format. |
date_time | string | Optional | A string representing the date in ISO 8601 format. If no time value is selected, the value of `date-time` will be `null`. |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: asana.addcustomfieldsettingfortable. Catalog operation: asana:addCustomFieldSettingForTable. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Required provider scopes: ["tables:write"]