Single Table Source with Variable Columns

We are currently using Metabase in our SaaS solution to provide reporting to different clients. Each time we add a new client and want to stand up reporting, we use the following project to deep copy the existing dashboard and questions and then manually go in and change the field numbers to the new data source. This is highly manual and also highly error-prone. I’m trying to identify a better way to approach the situation. While our clients share a lot of the same columnar data they will have a few additional columns each that are customized to their business. This creates a challenge when trying to create a single data source for Metabase. A single data source for Metabase would make it much easier to create a single dashboard that could be cloned without modifying the underlying field values in the Metabase database.

One approach that I have considered is being able to create an additional column and store the variable column data in each record for each client in JSON and then use Metabase to be able to parse out that JSON into its column. After doing some reading it doesn’t look like Metabase can do this and recommendations are to use views on the database. Once again if I use views for each client and attempt to clone an existing dashboard I will need to manually go update all the field references to point to the new data source (view) field values.

Has anybody come up with a good way to be able to leverage a single data source for a multi-tenant environment that allows for variability in the number of columns, but does not make one client’s columns visible to the others?

Hi @Slickrock22, I’m the creator of metabase_api_python repository. I believe all or a major part of what you are requesting can be done using the Metabase API.
I suggest you break down your request in multiple chunks and create separate tickets for them in the above repo. For example one part seems to be “changing the data source of a question/card”. Make sure to provide enough details, so it’s clear what you are asking.

Thanks! I documented my manual process and will begin to create some tickets. Thanks again!