TwentyDEV icon

TwentyDEV

Consume the Twenty API

Actions252

Overview

This node operation allows you to create a single "View Field" in the target system via an API call. A "View Field" represents a field configuration within a view, including its visibility, size, position, and optional aggregate operations. This is useful when you want to programmatically customize or extend views by adding new fields with specific display and aggregation settings.

Common scenarios include:

  • Automating dashboard or report configurations by adding fields dynamically.
  • Setting up views with customized field visibility and ordering.
  • Applying aggregate functions on fields for summarized data presentation.

For example, you might use this node to add a numeric field to a sales report view, set it visible, position it at the top, and apply a SUM aggregate operation to show total sales.

Properties

Name Meaning
Depth Determines how much nested related object information to include in the response: 0 (only primary object), 1 (primary + directly related objects), or 2 (primary + related + related of related).
Is Visible Boolean flag indicating whether the view field should be visible in the view.
Size Numeric value specifying the size of the view field (e.g., width or character length).
Field Metadata Id Required. The identifier of the target field metadata that this view field will represent.
View Id Identifier of the view to which this field will be added.
Position Numeric position/order of the view field within the view.
Aggregate Operation Optional aggregate function to apply on the field's data. Options include: AVG, COUNT, MAX, MIN, SUM, COUNT EMPTY, COUNT NOT EMPTY, COUNT UNIQUE VALUES, PERCENTAGE EMPTY, PERCENTAGE NOT EMPTY, COUNT TRUE, COUNT FALSE.

Output

The node outputs JSON data representing the newly created view field object as returned by the API. This typically includes all properties of the created view field such as its ID, visibility, size, position, associated field metadata, aggregate operation, and possibly nested related objects depending on the depth parameter.

If the API supports returning binary data for this operation (not indicated here), it would be summarized accordingly, but based on the provided info, output is JSON only.

Dependencies

  • Requires an API key credential to authenticate requests against the Twenty API.
  • The base URL for the API is configured from credentials.
  • The node uses standard HTTP headers for JSON content type.
  • No additional external dependencies are indicated.

Troubleshooting

  • Missing Required Fields: If Field Metadata Id is not provided, the API will likely reject the request. Ensure this required property is set.
  • Invalid Aggregate Operation: Using an unsupported aggregate operation value may cause errors. Use one of the predefined options.
  • API Authentication Errors: Ensure the API key credential is valid and has permissions to create view fields.
  • Incorrect View Id: Providing an invalid or non-existent view ID may result in a "not found" error.
  • Depth Parameter Misuse: Setting depth too high may increase response size unnecessarily; use appropriate level.
  • Network Issues: Check connectivity and API endpoint availability if requests fail.

Links and References

Discussion