How to Dynamically Switch Between Multiple Data Sources Based on Dashboard Variables in Grafana?

I’m working with Grafana and want to use a dashboard variable to dynamically switch between different data sources. Specifically, I have a variable (source) that selects layer-2 switches (e.g., switch1, switch2), and I have two Infinity data sources set up for these switches.

I want the dashboard to automatically switch the data source based on the selected value of the source variable so that the telemetry data for the appropriate switch is displayed.

Has anyone implemented this functionality or can provide guidance on how to achieve this?

What are the two datasources? If they are databases, are they installed on the same server?