Forum Discussion
Setting up Dynamic Connection Strings based on table value
Thank You for looking, I am not sure exactly how to ask this question.
The situation there are two groups that utilze 2 versions of basically the same tool to enter data. The problem is that they are using the tool fields slightly differently...so initially I setup data connections to both resources and then merged them into a single data set with a source field. That has been more of a headache than you can imagine. I am not going to be able to change how they are using the tools, so end of story for me is I need two seperate dashboards...each pointing to the groups individual data.
I don't want to develop and maintain two dashboards, what I would like to do is develop a single dashboard and then based on a flag, control the data connection properties.
What I would typically have done in sql of vba is have a table of Group and Flag and then toggle the flag depending on which group I want active. I would then have a second table that has Group, Connection and String...which I would lookup teh string value based on the flagged group and connection being requested.
So that is my conundrum, I hope it makes sense. I figure there has to be some way to establish parameters and dynamically control data connections...I am just not sure where to even begin. Below is a quick table of the groups and the connection locations.
Thank you in advance for any insight you are able to offer...and thank you for looking...
| Group | Flag |
| Minneapolis | Y |
| Saint Paul | N |
| Group | Connection | String |
| Minneapolis | Con1 | C:\MPLS\books.csv |
| Minneapolis | Con2 | C:\MPLS\tapes.csv |
| Minneapolis | Con3 | C:\MPLS\disks.csv |
| Saint Paul | Con1 | C:\SP\books.csv |
| Saint Paul | Con2 | C:\SP\tapes.csv |
| Saint Paul | Con3 | C:\SP\disks.csv |
3 Replies
- lbendlinSuper User
The base URL or URI (in case of folder connectors) for your data source must be constant. You need to use two separate connections.
- Gusd8Helper I
lbendlin, thank you for teh reply. OK, so is there any way to dynamically decide which connector to use based on some soft of flag?
Worst case scenario I save some code and when I create the duplicate pbix I go into the advanced editor and paste the correct script...but there are liek 9 connections...and I am lazy 😉 I am just so used to vba variables and flipping flag. Thank you in advance for your insight.
- lbendlinSuper User
Read about Deployment Pipelines and the way they use parameters for connection switching between instances.