Creating Dashboard using API

Hi,

I am trying to create a dashboard and connecting a metricset to it using REST API,

and am unable figure out how do i link them,though i am able to create dashboard and metric set seperately.

Hoping to find a solution.

Thank you

2 Likes

Drag the metric set onto the dashboard from the right side tool bar while in edit mode.

I am not sure there is any advantage to trying to get the metric set onto the dashboard via using the rest API.

Are you needing something special or are you just trying to get a metric set to a dashboard?


https://www.dundas.com/support/videos/ course 104 is the one to watch, unless you are trying to do something out of the ordinary.


If you could tell us more of what your are trying to accomplish we can help you better.

A lot of time it is best to just tell us the end results you are wanting so we or the actual Dundas guys can come up with the best way to do it. (it is a leason I had to learn myself and it get you to a solution quicker and the right one too).

Hi james,

thanks for the reply,

To be more precise, yes i am trying to do something different from ordinary,

I am creating a metric set dynamically based on the users column selection from predefined set of columns from a webpage,

This metric set has to be linked to the dashboard and displayed to the user on webpage.

I believe to achieve something like this i would have connect them using API

Where the end result(dashboard) will be displayed to the user


1 Like

You can go into the browser console via F12, and look at the network traffic. Whilst looking at this, drag the metric set onto the dashboard and watch what REST calls go through the network traffic panel in the console.

This should give you a big clue to the calls needed.

1 Like

dito, has I have not had a need for this yet that what I would do. I would probably eventual start pulling my hair out then ask support for help.


Thinking of what your end result actually is.......


a metric set that (not sure what kind but lets assume table but should work with other types) that the user picks what is shown.


https://www.dundas.com/support/developer/script-library/Controls/Table/Show-and-Hide-Columns

or

https://www.dundas.com/support/developer/script-library/controls/chart/show-or-hide-series


you might be able to put the metric set on the dashboard normally and just have the call set what columns/series to show.


What do you think, will that get you in the right direction of the end goal you are wanting?

2 Likes

Based on your description, you want the users to be able to see a visualization created based on their selected columns in your application. One way to achieve that which may be easier to do than trying to link a metric set to a dashboard via the API is to have a dashboard with a metric set on it that is using dynamic hierarchies and dynamic measures. Then all you will need to script is the selection of the right dynamic measure and dimensions based on the selection within your application webpage. You can learn more about dynamic elements under here. If this seems like a good solution, we can provide you with more details on how to script against those in order to set the selection (essentially it will be scripting the value of the dynamic element filter that may or may not be visible on your dashboard).

This path is much more recommended than the current path you are exploring which needs to take into account many possibilites and hence quite complex to implement. Let us know if this is a viable option for you.

2 Likes

Hi Ariel,

Thanks for your reply!

The method suggested is a better solution, but in my case, The metric sets would be created dynamically (I will use a dynamic query for generating the view in my DB and point a metric set to that view),Hence i won't be able to have metric on dashboard.


sorry if i was not clear about this earlier.

thanks for sharing those details. We probably need to better understand the entire use case and requirements to offer the best path moving forward but based on what we understand so far, another option to consider is keeping a fixed structure for your query (for example, have fixed placeholders for measure1, measure 2, row dimension 1, row dimension 2, slicer dimension 1 etc.) and generate the query using a stored procedure or manual query placeholders in a Dundas BI data cube that receives the parameters values (columns selection) from your web page (or even build that entire web page using a Dundas BI dashboard). Then you can create a fixed data cube and fixed metric set using the dynamic elements approach I mentioned above to be used on your dashboard. The downside here is that names of the columns will be fixed (i.e. column 1, column 2 etc.) instead of using the real column names but that may not be an issue for your visualizations depending on how you plan to present the data. You can also have scripts on the dashboards that will change the names (for example if you use a table visualization) to real column name. I think that this kind of solution will still be easier than creating a view every time and then generating new metrics and adding them to a dashboard on the fly via the API.

Hi Ariel,


Thank you for the previous reply.


The Above is the precise use case which we are trying to achieve.


Thanks for this - I understand that our embedding partners has reached out to you and you'll be working with them to find the best solution for this matter. Please do share your final solution in case it could be applicable to others.