Setting a Kusto dashboard tile's name dynamically based on a parameter value isn't
a native feature in Kusto Explorer as of the latest updates. However, you can
achieve a similar effect by programmatically updating the dashboard's configuration
using Kusto's dashboard JSON definition. This approach requires editing the
dashboard JSON configuration to include the parameter value in the tile name.
### Step-by-Step Guide
#### 1. **Define Parameters in Your Query**
Start by defining the parameter in your Kusto query that will be used to set the
tile name.
```kql
let StartDate = datetime({startDate});
let EndDate = datetime({endDate});
MyTable
| where Timestamp >= StartDate and Timestamp <= EndDate
| summarize Count = count() by bin(Timestamp, 1d)
| project Timestamp, Count
```
#### 2. **Set Up Parameters in the Dashboard**
Create parameters in your dashboard and set default values.
1. **Navigate to Parameters Tab:**
- Go to the Parameters tab in Kusto Explorer.
- Add `startDate` and `endDate` parameters with appropriate default values.
2. **Add Date Picker Controls:**
- Add Date Picker controls for `startDate` and `endDate` to your dashboard.
- Bind these controls to the corresponding parameters.
#### 3. **Edit the Dashboard JSON**
To dynamically set the tile name, you need to manually edit the dashboard's JSON
definition.
1. **Export Dashboard JSON:**
- In Kusto Explorer, export the current dashboard configuration to JSON.
2. **Modify the JSON:**
- Open the JSON file in a text editor.
- Locate the tile definitions within the JSON structure.
- Modify the `title` property of the tile to include the parameter value.
**Example JSON Modification:**
```json
{
"version": "1.0",
"name": "My Dashboard",
"parameters": {
"startDate": "2023-01-01",
"endDate": "2023-01-31"
},
"tiles": [
{
"type": "KustoTile",
"title": "Data from {startDate} to {endDate}",
"query": "let StartDate = datetime({startDate}); let EndDate =
datetime({endDate}); MyTable | where Timestamp >= StartDate and Timestamp <=
EndDate | summarize Count = count() by bin(Timestamp, 1d) | project Timestamp,
Count",
"parameters": {
"startDate": "2023-01-01",
"endDate": "2023-01-31"
}
}
]
}
```
In the above example, the `title` field of the tile is dynamically set to include
the `startDate` and `endDate` parameter values.
3. **Import Modified JSON:**
- Save the modified JSON file.
- Import the JSON back into Kusto Explorer to update the dashboard
configuration.
#### 4. **Test the Dashboard**
1. **Run the Dashboard:**
- Open the dashboard in Kusto Explorer.
- Use the Date Picker controls to select different date ranges.
2. **Verify Tile Names:**
- Ensure the tile names update dynamically based on the selected parameter
values.
### Summary
1. **Define parameters** in your query and dashboard.
2. **Add Date Picker controls** for the parameters.
3. **Export the dashboard JSON** configuration.
4. **Modify the JSON** to include parameter values in the tile names.
5. **Import the modified JSON** back into Kusto Explorer.
6. **Test the dashboard** to ensure tile names update dynamically.
This approach requires some manual steps but allows for dynamic tile naming based
on parameter values. If Kusto Explorer introduces more dynamic features in the
future, the process might become more straightforward.