---
schema_version: "1"
id: 869206c13e63d4bcc3caeeff577ecd0fd84efa01bdd8c90df7e6bf4824562eb9
title: source Step Type Properties
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/analytics/bi_dev_guide_json/guides/bi-dbjson-steps-sources.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-steps-sources.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 021853f5fa2c579d7fb1fd0305ed9c65529355fb6e05f34c67e5f2d60eb9beae
products:
  - Analytics Dashboard JSON Developer Guide
  - analytics
---

# source Step Type Properties

Use the `sources` property to add `columns`, `groups`, `filters`, and formulas to a step query.

| Field Name    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `columns`     | The columns for the source. For more information, see [columns Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-steps-columns.md).                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `groups`      | The dimensions to group the data in the source.                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `filters`     | The filters applied to the columns in the source. For more information, see [filters Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-steps-filters.md)                                                                                                                                                                                                                                                                                                                                                                                             |
| `name`        | The name of the data source. If the query has formula columns, they’re added as the last source without the `name` property.                                                                                                                                                                                                                                                                                                                                                                                             |
| `cogroupType` | When there are multiple data sources with different `name` properties, this parameter is used to define which records are included in the blended data for this query. Valid values for `cogroupType` are `left`, `right` `inner` `full`. For `left` and `right` blends, the initial dataset or blend is considered the left one. For more information on data blending, see [Explore Multiple Datasets with a Single Query](https://help.salesforce.com/articleView?id=analytics.bi_explorer_data_blending.htm&type=5). |

## Example: Grain Query

```nolang
"sources": [
    {
        "columns": [
          {
            "field": "Customer_Name",
            "name": "Customer_Name"
          },
          {
            "field": "Customer_Segment",
            "name": "Customer_Segment"
          },
          {
            "field": "Product_Name",
            "name": "Product_Name"
          },
          {
            "field": "City",
            "name": "City"
          },
          {
            "field": "Order_ID",
            "name": "Order_ID"
          },
        ],
        "groups": [],
        "filters": [],
        "name": "SuperStoreSales"
    }
]

```

## Example: Query without groupings

When a query isn’t grouped by a dimension, set `groups` to `["all"]`

```nolang
"sources": [
    {
        "columns": [
          {
            "field": ["sum", "Amount"]
            "name": "A"
          },
        ],
        "groups": ["all"],
        "filters": [],
        "name": "SuperStoreSales"
    }
]

```

## Example: Query with groupings

```nolang
"sources": [
    {
        "columns": [
          {
            "field": ["sum", "Amount"]
            "name": "A"
          },
        ],
        "groups": ["Customer_Segment", "Order_priority"],
        "filters": [],
        "name": "SuperStoreSales"
    }
]

```

## Example: Query with formula column

```nolang
"sources": [
    {
        "columns": [
          {
            "field": ["sum", "Amount"]
            "name": "A"
          },
          {
            "formula": "case \nwhen starts_with('Product_Container', \"Small|") then null\nelse count()\nend\n",
            "name": "B"
          }
        ],
        "filters": [],
        "groups": [
            "Order_Priority",
            "Product_Container"
        ],
        "name": "SuperStoreSales"
    }
]

```

## Example: Query with columns referencing formulas

Formula columns are defined in a separate source without a `name` property.

```nolang
"sources": [
    {
        "columns": [
          {
            "field": ["sum", "Amount"]
            "name": "A"
          }
        ],
        "groups": ["Customer_Segment", "Order_Priority"],
        "filters": [],
        "name": "SuperStoreSales"
    },
    {
        "columns": [
          {
            "forumula": "A*2",
            "name": "B"
          },
          {
            "forumula": "B/100",",
            "name": "C"
           }
         ]
    }
]

```

## Example: Query with multiple data sources

```nolang
"sources": [
    {
        "columns": [
          {
            "field": ["avg", "Profit"]
            "name": "A"
          }
        ],
        "groups": ["City"],
        "filters": [],
        "name": "SuperStoreSales",
        "cogroupType": "left"
    },
    {
        "columns": [
          {
            "field": ["sum", "Amount"],
            "name": "B"
          }
        ],
        "groups": ["City"],
        "filters": [],
        "name": "Opportunity"
    }
]

```
