TwentyDEV icon

TwentyDEV

Consume the Twenty API

Actions252

Overview

This node allows creating multiple "Views" in a system that supports nested related objects. It is designed to send batch requests to create many views at once, specifying details such as the view's name, metadata ID, and how deeply related objects should be included in the response.

Common scenarios include:

  • Automating the creation of multiple customized views for dashboards or data presentations.
  • Bulk setup of views with specific aggregation operations and display preferences.
  • Integrating with systems where views represent saved filters or layouts, enabling programmatic management.

For example, you might use this node to create several kanban board views with different aggregation settings or to set up multiple side-panel views for different object metadata IDs.

Properties

Name Meaning
Depth Determines the level of nested related objects to include in the response:
- 0: Only the primary object's information.
- 1: Primary object plus directly related objects (no further nesting).
- 2: Primary object, its related objects, and their related objects.
Body JSON object defining the views to create. Typical fields include:
- kanbanAggregateOperation: Aggregation method like AVG.
- key: Identifier key such as INDEX.
- openRecordIn: How to open records (e.g., SIDE_PANEL).
- objectMetadataId: The ID of the object metadata.
- name: The name of the view.

Output

The node outputs JSON data representing the created views. Each item in the output corresponds to a view created according to the input body specification. The JSON includes all properties of the created views, potentially including nested related objects depending on the Depth parameter.

If binary data were involved, it would typically represent files or attachments related to the views, but this node focuses on JSON data only.

Dependencies

  • Requires an API key credential to authenticate requests to the external service managing views.
  • The base URL and authentication token must be configured in the node credentials.
  • The node uses an OpenAPI-based client internally to communicate with the external API.

Troubleshooting

  • Invalid JSON in Body: If the JSON provided in the Body property is malformed, the node will fail. Ensure valid JSON syntax.
  • Authentication Errors: Missing or incorrect API credentials will cause authorization failures. Verify the API key and domain configuration.
  • Invalid Object Metadata ID: Providing an incorrect or non-existent objectMetadataId will result in errors from the API. Confirm the ID is correct.
  • Depth Parameter Misuse: Setting an unsupported depth value may lead to unexpected responses or errors. Use only 0, 1, or 2 as specified.
  • API Rate Limits: Creating many views at once might hit rate limits; consider batching requests or adding delays if errors occur.

Links and References

  • Twenty API Documentation (example placeholder, replace with actual API docs)
  • JSON formatting tools for validating the Body property input
  • n8n documentation on using JSON and API credentials

Discussion