Skip to content

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.

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 os
from alter_sdk import App
from 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()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.table_gidstringRequired within parent
queryobjectOptionalAdditional keys: not allowed
query.opt_prettybooleanOptional
query.opt_fieldsarrayOptional
query.opt_fields[]stringEach itemOne 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
bodyobjectRequired within parent
body.dataModelRequired within parentExpand 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 media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$JSONRoot
$ (allOf 1)objectAll variants apply
$ (allOf 1).dataModelOptionalExpand Add a custom field to a table — response body — data data — Custom Field Table Setting Response
$ (allOf 2)ModelAll variants applyExpand 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

7 more schemas are linked from the tables above, on the schema pages.

Add a custom field to a table — request body — body data
FieldTypePresenceDescription and constraints
$objectRoot
custom_fieldJSONRequired within parent
custom_field (oneOf 1)stringAlternativeThe custom field to associate with this container.
custom_field (oneOf 2)ModelAlternativeExpand 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_importantbooleanOptionalWhether this field should be considered important to this container (for instance, to display in the list view of items in the container).
insert_beforestringOptionalA 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_afterstringOptionalA 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.

Referenced models: 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

Add a custom field to a table — response body — data data — Custom Field Table Setting Response
FieldTypePresenceDescription and constraints
$JSONRoot
$ (allOf 1)ModelAll variants applyExpand Add a custom field to a table — response body — data data gid, resource type
$ (allOf 2)objectAll variants apply
$ (allOf 2).custom_fieldJSONOptional
$ (allOf 2).custom_field (allOf 1)ModelAll variants applyExpand Get a membership — response body — data / data / access_level: admin, editor, user parent
$ (allOf 2).custom_field (allOf 2)objectAll variants applyThe custom field that is applied to the table.
Read only: true
$ (allOf 2).is_importantbooleanOptional`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
FieldTypePresenceDescription and constraints
$objectRoot
dataModelRequired within parentExpand 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
FieldTypePresenceDescription and constraints
$JSONRoot
$ (allOf 1)ModelAll variants applyExpand 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)objectAll variants apply
$ (allOf 2).resource_subtypestringRequired within parentThe type of the custom field. Must be one of the given values.
One of: text, enum, multi_enum, number, date, people, reference

Referenced models: 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

Add a custom field to a table — response body — data data gid, resource type
FieldTypePresenceDescription and constraints
$objectRootA *custom field table setting* represents the many-to-many join of a custom field and a table, storing information relevant to that particular pairing.
gidstringOptionalGlobally unique identifier of the resource, as a string.
Read only: true
resource_typestringOptionalThe 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
FieldTypePresenceDescription and constraints
$objectRootA 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.
gidstringOptionalGlobally unique identifier of the resource, as a string.
Read only: true
resource_typestringOptionalThe base type of this resource.
Read only: true
custom_fieldModelOptionalExpand Add a custom field to a table — response body — data data custom field
is_importantbooleanOptional`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
FieldTypePresenceDescription and constraints
$JSONRoot
$ (allOf 1)ModelAll variants applyExpand 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)objectAll variants apply
$ (allOf 2).workspacestringRequired within parent*Create-Only* The workspace to create a custom field in.
$ (allOf 2).owned_by_appbooleanOptional*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_valuearrayOptional*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[]stringEach itemA string identifying a user. This can either be the string "me", an email, or the gid of a user.
$ (allOf 2).reference_valuearrayOptional*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[]stringEach itemThe GID of an object.

Referenced models: 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

Get a custom field — response body — data data date value date, date time
FieldTypePresenceDescription and constraints
$objectRoot*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`.
datestringOptionalA string representing the date in YYYY-MM-DD format.
date_timestringOptionalA string representing the date in ISO 8601 format. If no time value is selected, the value of `date-time` will be `null`.

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"]

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.