cancel
Showing results for 
Search instead for 
Did you mean: 
Warehousing & Analytics
Engage in discussions on data warehousing, analytics, and BI solutions within the Databricks Community. Share insights, tips, and best practices for leveraging data for informed decision-making.
cancel
Showing results for 
Search instead for 
Did you mean: 

Can {{input}} from a For Each task be used as a dashboard subscription destination_id

dario66952
New Contributor

Hello everyone,

I am using a DAB to send a dashboard snapshots to notification destinations.

The intended design is to use a For each task for multiple team/destination pairs. As a minimal test, I am iterating over an array containing one notification destination ID:

variables:
  destination_1_nonprod:
    lookup:
      notification_destination: destination_1_nonprod

  team_subscriptions:
    description: JSON array of notification destination IDs
    default: '["${var.destination_1_nonprod}"]'

 

resources:
  jobs:
    job1:
      ...

      parameters:
        - name: team_subscriptions
          default: ${var.team_subscriptions}

      tasks:
        - task_key: send_team_reports
          for_each_task:
            inputs: "{{job.parameters.team_subscriptions}}"
            concurrency: 5

            task:
              task_key: send_team_report
              dashboard_task:
                dashboard_id: ${resources.dashboards.my_dashboard.id}
                warehouse_id: ${var.warehouse_id}
                subscription:
                  subscribers:
                    - destination_id: "{{input}}"

The bundle correctly resolves team_subscriptions to a JSON array containing the notification destination UUID and I can see that in the UI inside the task "job parameters".

The job succeeds but no notification is delivered, silently ignoring the issue.

As a control test, replacing the dynamic reference with the bundle lookup works correctly:

subscription:
  subscribers:
    - destination_id: ${var.destination_1_nonprod}

I also 

I also considered using a json object with key:value and iterating over it using:  

destination_id: "{{input.destination_id}}"

but it still silently fail the delivery 

 

 

Does dashboard_task.subscription.subscribers[].destination_id support Lakeflow dynamic value references such as {{input}} or {{input.destination_id}}?

If it does, what is the correct syntax or configuration?

Thank you for your attention 

 

1 ACCEPTED SOLUTION

Accepted Solutions

adnan_alvee
Databricks Employee
Databricks Employee

dashboard_task.subscription.subscribers[].destination_id does not appear to support Lakeflow dynamic value references such as {{input}} or {{input.destination_id}}. Public docs show dynamic values for For each inputs and nested task parameters, and dashboard-task parameterization is currently documented for dashboard filter values, not subscriber destination fields.

That’s why a bundle-resolved value like 
${var.destination_1_nonprod} works, while the runtime {{input}} form validates as a string but does not result in delivery. At the moment, the safe pattern is to emit one task per concrete destination ID (or generate those tasks ahead of deployment), rather than trying to parameterize subscription.subscribers[].destination_id at run time.

View solution in original post

1 REPLY 1

adnan_alvee
Databricks Employee
Databricks Employee

dashboard_task.subscription.subscribers[].destination_id does not appear to support Lakeflow dynamic value references such as {{input}} or {{input.destination_id}}. Public docs show dynamic values for For each inputs and nested task parameters, and dashboard-task parameterization is currently documented for dashboard filter values, not subscriber destination fields.

That’s why a bundle-resolved value like 
${var.destination_1_nonprod} works, while the runtime {{input}} form validates as a string but does not result in delivery. At the moment, the safe pattern is to emit one task per concrete destination ID (or generate those tasks ahead of deployment), rather than trying to parameterize subscription.subscribers[].destination_id at run time.