A new functionality allows deploy dashboards with a asset bundles. Here is an example :
# This is the contents of the resulting baby_gender_by_county.dashboard.yml file.
resources:
dashboards:
baby_gender_by_county:
display_name: "Baby gender by county"
warehouse_id: aae11o8e6fe9zz79
file_path: ../src/baby_gender_by_county.lvdash.json
In my dashboard Data section I have datasets and I want pass parameters to the query and use as parameter the same as I can do in jobs. Lets say catalog name, so I can specify variable and pass it in the bundle to deploy same dashboard to dev, prod:
SELECT * FROM IDENTIFIER(:catalog||'.my_schema.my_table')
And dashboard json file will have my parameters value from the bundle:
"datasets": [
{
"displayName": "My Dashboard",
"name": "16b8c208",
"parameters": [
{
"dataType": "STRING",
"defaultSelection": {
"values": {
"dataType": "STRING",
"values": [
{
"value": "prod"
}
]
}
},
"displayName": "catalog",
"keyword": "catalog"
}
],
"query": "SELECT * FROM IDENTIFIER(:catalog||'.my_schema.my_table')"
},
Is it possible to pass parameters for Dashboards Datasets in asset bundles?
Or may be there is another way how to deploy the same json dashboard to PROD, DEV and somehow change queries, to use dev catalog in dev workspace, prod catalog in prod?