Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Views String Aggregation

249 sites Security covered Drupal 9 · not 10, 11 Views ecosystem
View on drupal.org

This module extends Drupal Views to aggregate and concatenate string fields at the database level. It allows you to combine multiple text values into a single string, with options to customize separators, ordering, and distinct values, all handled natively by your database.

Views String Aggregation is a new module that extends Drupal Views with database-level string aggregation and concatenation capabilities.

If you would like to combine values into concatenated string results, using more than the default core numeric aggregation options, then Views String Aggregation provides an SQL-native solution.

Key features

SQL optimized

String aggregation and concatenation happens at the SQL level using native database functions, such as GROUP_CONCAT and STRING_AGG.

Flexible configuration

  • Choose a separator (e.g comma, pipe, space etc..)
  • Order concatenated values by selected field
  • Sort concatenated values ASC or DESC
  • Show distinct values only
  • Set group_concat_max_len (MySQL/MariaDB)
  • Automatic Views integration

Supports multiple database types

  • MySQL/MariaDB: Uses GROUP_CONCAT with max length, custom separator, ordering and distinct support
  • PostgreSQL: Uses STRING_AGG with custom separator, ordering and distinct support
  • SQLite: Uses GROUP_CONCAT with custom separator, ordering and distinct support
  • Database type is detected and handled automatically

Easy to use

No complex configuration required. Simply enable aggregation in your View and set a field to use "String aggregation" type.

Views String Aggregation field settings

Fig 1: New field aggregation settings are provided for string aggregation.

Example

Uses

  • Content aggregation: Display all values for a field grouped by other field value
  • Commerce: Display all order item titles grouped by order
  • REST API endpoints: Create Views REST API response data including aggregated and concatenated field data
  • Data exports: Create Views CSV exports including aggregated and concatenated field data
  • etc…

Results

Before: Multiple rows per content item

Title Value Getting Started with Drupal drupal Getting Started with Drupal tutorial Getting Started with Drupal beginner

After: Aggregated and concatenated results as a comma separated string

Title Values Getting Started with Drupal drupal, tutorial, beginner

Installation & Usage

  1. Install the module using Composer (recommended) or by downloading manually
  2. Enable the module: e.g:drush en views_string_aggregation
  3. In your View, enable Use aggregation in Advanced settings
  4. Set desired fields to String aggregation or String aggregation DISTINCT aggregation type
  5. Optionally configure grouping, e.g customize separator, max string length or order by field, under Advanced > Other > Query Settings

That's it! Your View will now display nicely aggregated string data.

Usage note:

Aggregation happens at the SQL level. Be aware of how the fields you configure to use the default “Group by” type aggregation affect the result. For example grouping by a node id field will show records grouped by node id on separate rows. However, you could for example use string aggregation to show a set of node ids grouped by type.

Similar modules

Views Aggregator Plus

Differences

  • Views Aggregator Plus provides a custom Views table display with a variety of aggregation features, using PHP at the display level.
  • Views String Aggregation is different because it works for any aggregation-enabled Views display and provides string aggregation using native SQL functions at the query level.

Acknowledgements

This module acknowledges with thanks the initial work contributed in https://www.drupal.org/project/drupal/issues/2902481 namely by

Requirements

  • Drupal 9.x, 10.x or 11.x
  • Views module (included in Drupal core)
  • MySQL 5.7+, MariaDB 10.2+, SQLite 3+ or PostgreSQL 9.1+

Note: A legacy Drupal 9 version is also available.

Depends on

Dependencies of the latest stable release

  • views Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
15
Tracked since
Sep 2025
Latest release
11 months ago
Releases (12 mo)
15 ▲ from 0
Maintenance
Slowing

Release Timeline

Releases

Version Type Core Release date
9.0.0 Stable 9 Sep 21, 2025
9.0.x-dev Dev 9 Sep 21, 2025
1.0.2 Stable 10–11 Sep 19, 2025
1.0.1 Stable 10–11 Sep 17, 2025
1.0.0-rc10 Pre-release 10–11 Sep 9, 2025
1.0.0-rc9 Pre-release 10–11 Sep 9, 2025
1.0.0-rc8 Pre-release 10–11 Sep 8, 2025
1.0.0-rc7 Pre-release 10–11 Sep 7, 2025
1.0.0-rc6 Pre-release 10–11 Sep 7, 2025
1.0.0-rc5 Pre-release 10–11 Sep 7, 2025
1.0.0-rc4 Pre-release 10–11 Sep 7, 2025
1.0.0-rc3 Pre-release 10–11 Sep 7, 2025
1.0.0-rc2 Pre-release 10–11 Sep 7, 2025
1.0.0-rc1 Pre-release 10–11 Sep 6, 2025
1.0.x-dev Dev 10–11 Sep 6, 2025