# How to configure Card Grouping

### Introduction

Card Groups is a new layer of visualization and management of cards.&#x20;

One feature of these card groups is their customizable visual styles. This means that a stack of cards and an individual card can be visually distinct, making it easier to identify and differentiate.&#x20;

Another feature is a set of aggregation functions for calculating several kinds of totals:

* Maximum
* Minimum
* Sum
* Average

These functions are instrumental in providing meaningful insights into your data, aiding in more informed decision-making and efficient project management within the Salesforce CRM platform.

{% hint style="info" %}
This feature is available since release 3.1.37
{% endhint %}

To make card groups you just need to have a kanban with columns configured on some Data Source object.&#x20;

### Basic Configuration

Let's use Opportunities in the following example. The Kanban will have 4 columns for several Opportunity stages.

{% hint style="info" %}
Distributing cards by columns - is the top layer of records representation and management  in kanban. Card grouping offers a second layer.
{% endhint %}

Here how a kanban can look like without grouping:

<img src="https://3097383375-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK2dgObBO5ydOH2ZXDJLa%2Fuploads%2FYloXDblHF1ChGhn7BUpy%2Ffile.excalidraw.svg?alt=media&#x26;token=e10a9120-633d-420c-8047-d0d4451e8446" alt="" class="gitbook-drawing">

We can add grouping by some fields of Data Source object.&#x20;

{% hint style="info" %}
Groupable field types:

* Checkbox (boolean)

* Phone (string)

* Picklist (string)

* Email (string)

* Text (string)

* Text Area (string)

* URL (string)

* Number (int). Does not include custom fields, only standard Number fields with SOAP type <mark style="color:red;">`int`</mark>, like <mark style="color:red;">`Account.NumberOfEmployees`</mark>.

* Lookup (id)

* Master Detail (id)

* Id (id)

* Date (date)

* Formulas of type Checkbox and Date, including cross-object formulas across standard and custom relationships.
  {% endhint %}

* Open Column Config popup and go to "Grouping Configuration" tab.

* Click <img src="https://3097383375-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK2dgObBO5ydOH2ZXDJLa%2Fuploads%2Fpy86SEpBzn2VhHMTCuze%2Fimage.png?alt=media&#x26;token=a0254f94-3e02-4c23-ac35-ac783ec9b6c5" alt="" data-size="line"> button to select a Data Source field in "Group by" picker:

<img src="https://3097383375-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK2dgObBO5ydOH2ZXDJLa%2Fuploads%2F2hMYf9t537NvPJBKsvWQ%2Ffile.excalidraw.svg?alt=media&#x26;token=5a2dbc6b-b246-4d28-a70a-c6a4c925ee9a" alt="" class="gitbook-drawing">

* A field picker will appear. Select a field (fields of up to 4 levels are available) and click "Apply" button:

<img src="https://3097383375-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK2dgObBO5ydOH2ZXDJLa%2Fuploads%2FqUnnijy3rcszQxJJw5oX%2Ffile.excalidraw.svg?alt=media&#x26;token=7840ccdc-58b9-458e-9b52-67747f3e0be0" alt="" class="gitbook-drawing">

* Save changes:

<img src="https://3097383375-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK2dgObBO5ydOH2ZXDJLa%2Fuploads%2FSVWa9plmXyWT6WX5HM6f%2Ffile.excalidraw.svg?alt=media&#x26;token=6213ccb3-7aac-4155-babc-abbb3d589c80" alt="" class="gitbook-drawing">

This is enough to add groups to the column. These groups will automatically receive a header that will correspond to the value of selected field, and will contain only cards that have this value set.

Here how a kanban can look like with card grouping in the last column:

<img src="https://3097383375-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK2dgObBO5ydOH2ZXDJLa%2Fuploads%2FnA5oNgeXyiRIkX3PekLy%2Ffile.excalidraw.svg?alt=media&#x26;token=670a7af0-f74d-46c7-bad7-ec310fa86ecc" alt="" class="gitbook-drawing">

{% hint style="warning" %}
If some cards have no value in the field which cards are grouped by, these cards will not be included in any group.
{% endhint %}

Card groups have the following features:

* They are collapsed by default and show only the first card. To expand a group click <img src="https://3097383375-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK2dgObBO5ydOH2ZXDJLa%2Fuploads%2FEHnTbxNI4ekpUcLVDZu3%2Fimage.png?alt=media&#x26;token=c38cbbf5-ab25-463f-9586-29a1b546af58" alt="" data-size="line"> button at the group header.
* Card grouping does not cancel column sorting order - it will be matched inside groups too.
* If group contains many cards, not all of them can be displayed - in this case a "load more" button will be shown at the bottom of expanded group.

{% hint style="warning" %}
Only one Card Group is allowed per column.
{% endhint %}

### Other Features

Card Groups offer following abilities:

* Styling
* Show totals
* Use conditions to include cards in the group

#### Styling

Add CSS styles using proper Styles picker:

<img src="https://3097383375-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK2dgObBO5ydOH2ZXDJLa%2Fuploads%2FFUq9QmmzoJ7WCHd14cBS%2Ffile.excalidraw.svg?alt=media&#x26;token=a20c8662-6b4a-44d2-87c6-aa3f6645b1a0" alt="" class="gitbook-drawing">

You can use merge fields in styles to make groups styled dynamically depending on different values.

#### Totals

* Click <img src="https://3097383375-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK2dgObBO5ydOH2ZXDJLa%2Fuploads%2Fqqc7mcOt3Uj6PHtiGAfz%2Fimage.png?alt=media&#x26;token=3ccea17f-0254-4386-858c-67b749d37e91" alt="" data-size="line"> button to show proper subform for Totals entry.
* Type Label (text that will be displayed left to value).
* Select aggregation method in "Details" column. Currently available methods are:
  * Sum (proper values from all cards belonging to the group will be added)
  * Minimum (will show minimal value)
  * Maximum (will show maximal value)
  * Average (will calculate and show average value)
* Select a field which Total will be aggregated by
* Set CSS styles (e.g., color) for this Total, if necessary

You can add several Totals:

<img src="https://3097383375-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK2dgObBO5ydOH2ZXDJLa%2Fuploads%2FQi3wdhXq9PBMqhEbMJpw%2Ffile.excalidraw.svg?alt=media&#x26;token=9f9b12c0-427a-40a6-b02b-8279adbaeb18" alt="" class="gitbook-drawing">

How can look card groups with styling and Totals:

<img src="https://3097383375-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK2dgObBO5ydOH2ZXDJLa%2Fuploads%2F9SrAiQkwhOYKMuYV0Z2v%2Ffile.excalidraw.svg?alt=media&#x26;token=47ab9e4f-9cf7-4e5a-b670-88b7417fd1ea" alt="" class="gitbook-drawing">

#### Conditions

To make card grouped more efficiently, you can specify conditions. Only cards, whose records match conditions, will be grouped.

* Go to "Conditions" section of Grouping Configuration tab
* Click <img src="https://3097383375-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK2dgObBO5ydOH2ZXDJLa%2Fuploads%2F6mesSJJD9Z9cKWoF5bpD%2Fimage.png?alt=media&#x26;token=f63ab9a1-5cb5-4918-8f98-5550c3fe9a2a" alt="" data-size="line"> button to add condition
* Select Data Source Object field, operator and type
* Specify value to be matched
* Add more conditions, if necessary
* Set conditions Logic, if needed

In the example below Opportunity cards will be grouped by Account Name only for two specified accounts:

<img src="https://3097383375-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK2dgObBO5ydOH2ZXDJLa%2Fuploads%2FMQomE6ylU5PzP5E1OHFp%2Ffile.excalidraw.svg?alt=media&#x26;token=3f2b101d-4f16-44de-baa8-2766647e0371" alt="" class="gitbook-drawing">

And how result will look like:

<img src="https://3097383375-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK2dgObBO5ydOH2ZXDJLa%2Fuploads%2Fz7EKjPetiXFdnlzK5djr%2Ffile.excalidraw.svg?alt=media&#x26;token=a54f7648-7dbe-4d18-a04d-98ad339f5376" alt="" class="gitbook-drawing">
