Views Code Data Module Executes Drupal Views as Structured Data

Views Code Data Module Enables Programmatic Execution of Drupal Views

Views Code Data is a new Drupal module that allows Views displays to be executed programmatically and return structured output such as arrays, JSON, JSON Lines or delimited text without rendering markup or defining HTTP routes.

Created by Chad Peppers and released on 18 February 2026, the module turns Views into a configurable query builder for custom code. Developers can add a dedicated Code display to an existing view and execute it via the views_code.manager service.

The service exposes methods including execute(), json(), jsonl(), delimited(), first(), pluck() and count(), with optional limit and offset parameters for pagination and batch processing.

The module includes a Raw Values mode that bypasses the field rendering pipeline to improve performance. Benchmark figures published on the project page compare entity loading, rendered Views output, raw mode and direct database queries.

Additional features include Drush commands for table output, JSON, JSON Lines and delimited exports, contextual filter support, and a hook to alter collected data before it is returned.

According to the project page, Views Code Data is not covered by the Drupal Security Advisory Policy.

Note: The vision of this web portal is to help promote news and stories around the Drupal community and promote and celebrate the people and organizations in the community. We strive to create and distribute our content based on these content policy. If you see any omission/variation on this please reach out to us at #thedroptimes channel on Drupal Slack and we will try to address the issue as best we can.

Related People

Upcoming Events

Latest Opportunities