Displaying parameter values in report html


Is there any way to include or access the report parameters in the report's html? This would really in giving viewers of a report more clarity on what parameters it was run with. 

For example it's currently possible to bind the Report's title in the html content using :

<h1>{{ title }}</h1>

However the following does not work for parameters:

<p>{{ param_name }}</p>

Furthermore this would be extremely useful for cross-linking or drilling down into other reports using the same parameters.


18replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Hi Sebastien!

    You can do this with a bit of custom HTML and making sure you add your parameter as a column in your query.  Here's an example report that does this:


    You will notice that the search parameter has been added as a column:

      COUNT(touchdown_id) AS total_touchdowns,
      SUM(yards) AS yards,
      '{{search}}' AS search
      team = '{{search}}'
      AND season = {{season}}
    GROUP BY 1

    I then pull the parameter value using this and a bit more Javascript:

    var param = dataset.content[0].search;
     //Find "param" and "last" elements in page and set the contents of those elements (<span>'s in the title above) to the param and last variable values
    //Use chart title "Chart Title" to replace with Tototal Touchdowns by {{search parameter}}
      var titles = {
        "Chart Title" : "Total Touchdowns by " + param,
        //Needs to be the query name + Results
        "Query 1 Results" : "Results for " + param
    //Need this timeout for things to render correctly
      //Set chart title to the new "Total Touchdowns by {{search parameter}}
      $(".chart-header").each(function() {
        var title = $.trim($(this).text()),
            trimmed = $.trim(title.slice(0,title.length - 28));
        if (trimmed in titles) {
    }, 1000);</script>


    which sets the span for the report title (param)

    <div class="mode-header embed-hidden">
      <h1>{{ title }}
        <span id="param"></span>...

    Let me know how this works for you!

    Reply Like 1
  • Hi Donna , thanks a lot for getting back to me! The solution works great although this feels a bit like a workaround. Would you know if there are any plans at all to support binding params in reports ?

    Reply Like
  • Hi  Sebastien , I've submitted a request to our product team to see if we could allow the insertion of parameter values in Report Builder for things like report title, etc..   Have a happy Thanksgiving!  

    Reply Like 1
  • Donna McGahan I would also *love* to have this feature. It would be an amazing addition to Reporting. 


    Another thing --- following the example, how would you add "Season" to the script? Currently, the script returns: "SUPPORT DEMO - Touchdowns by MIA Last Opponent: BUF" ... how do you get "SUPPORT DEMO - Touchdowns by MIA Last Opponent: BUF - 2014 Season" (or similar)?

    Reply Like
  • Chris Short  If you add season as a column in your SQL, you can then add it as another parameter for use in the HTML.  I've updated my example report to include season for report and chart title:


    Let me know if that makes sense.  Thanks!

    Reply Like 1
  • +1 on this feature as well. It would be really nice to have the start date and end date parameters render on the report itself. Especially once it is saved via pdf so users can see the start date and end date ran on the report. For example, Report Start Date: "12/1/2016 " Report End Date: "1/1/2017"

    Reply Like 1
  • +1 for part of the original request as well, specifically the part about exposing parameters to be used in links to other reports.

    I know it's possible to pass params to other pages by embedding links in the data tables (which is a huge help by the way), but it'd be great to be able to include params in something like the text editor where links can be added. 

    A use case would be when analyzing a user account where they are both a buyer and a seller on an ecommerce platform. Instead of including an analysis of both profiles, if the we were able to add free text saying "Evaluate Seller Metrics" on the Buyer page that appends the proper param to a report link (and vice versa on the other page), then that would help declutter report pages while showing proper linkage and navigability.

    Reply Like
  • +1 for the request as well

    Reply Like
  • +1 for this feature request.


    My use case is around building links to other applications.  So if I have set a parameter for {{ user_id }} = "bob@bobber.com", I will run a bunch of queries using that parameter in Mode, but I also need to construct links to other stuff.  For example, <a href="https://some.other.app/?user_id= {{ user_id }}">Click here to view view this user in the directory</a>

    Reply Like
  • +1 to this feature request for sure!

    Also,  Donna McGahan it looks like your example files are not accessible. 

    Reply Like
  • John Stetic Hey John! Sorry about it. Here's the example: https://modeanalytics.com/modeanalytics/reports/e968e09c5064

    Reply Like 1
  • +1 for this feature - It would be really useful to be able to add parameter values to titles without this tricky workaround. Periscope does this :))

    Reply Like
  • My work around is pretty simple:

    1) Create a second query with something like select '{{ user_id }}' as user.

    2) Add this to your HTML:

    var results = datasets.filter(function(d) {
        return d.queryName == "YOUR QUERY NAME HERE";

    var user = results[0].user;


    3) Then you can use at at you please. In the initial example, you could just create the <p> tag with an id as such; <p id="userElement"></p>.

    4) Then just add this below your javascript you already have document.getElementById("userElement").innerHTML = user;


    I think this is a pretty simple work around here!

    Hope this helps!

    Reply Like
  • Nick Howell thx Nick, this worked very nicely. Except when exporting the report to PDF the parameter values are empty. Mode bug I suspect.

    Reply Like
  • +1 for this feature. Tell me this is already available, please :)

    Reply Like
  • +1 for this request too!

    Reply Like
  • Hey chenna Varri and Laura Richter , this feature is still in the works. Happy to add your voices to the request though!

    Reply Like 1
  • This one is long overdue. Two years...

    The parameters should likewise be accessible in the Notebook as {{parameter}} without having to resort to having the parameters as columns in the select/dataframe

    Reply Like
Like3 Follow
  • Status Answered
  • 4 mths agoLast active
  • 18Replies
  • 2752Views
  • 17 Following