TwentyDEV icon

TwentyDEV

Consume the Twenty API

Actions252

Overview

This node operation updates a single "View Sort" object in an external system via its API. It allows users to modify sorting criteria applied to views, such as changing the field by which data is sorted or the direction of the sort (ascending/descending). This is useful in scenarios where dynamic reordering of displayed data is needed based on user preferences or automated workflows.

Practical examples include:

  • Adjusting the sort order of a dashboard view after new data is added.
  • Changing the sorting field and direction for reports generated automatically.
  • Updating nested related objects' depth to control the detail level returned in the response.

Properties

Name Meaning
Id The unique identifier of the View Sort object to update. This is required to specify which sort entry will be modified.
Depth Controls how many levels of nested related objects are included in the response: 0 returns only the primary object; 1 includes directly related objects; 2 includes related objects of those related objects.
View Id The identifier of the view to which this sort applies.
Direction The direction of the sort, typically indicating ascending or descending order.
Field Metadata Id The identifier of the target field used for sorting within the view.

Output

The node outputs JSON data representing the updated View Sort object. The structure reflects the updated properties of the sort, including any nested related objects depending on the Depth parameter. No binary data output is indicated.

Dependencies

  • Requires an API key credential to authenticate requests to the external Twenty API service.
  • The base URL for API requests is configured dynamically from credentials.
  • Uses the @devlikeapro/n8n-openapi-node package to build request properties from an OpenAPI specification.

Troubleshooting

  • Invalid Id: If the provided Id does not correspond to an existing View Sort, the API may return a "not found" error. Verify the Id before running the node.
  • Authentication errors: Ensure that the API key credential is correctly set up and has sufficient permissions.
  • Invalid fieldMetadataId or viewId: Providing incorrect identifiers for the field or view can cause the update to fail. Double-check these values.
  • Depth parameter misuse: Setting an unsupported depth value might result in incomplete or unexpected response data.

Links and References

Discussion