Append the custom grafana dashboard into the current dashboard created by javascript (scripted dashboard)

The below js is creating the dashboard with 2 rows : Basic & Advanced and with “dashboard.links” to the custom dashboard based on the “service” tag.
I am looking the way to append this custom dashboard as additional row to the current dashboard,
so during the creating the dashboard check if any custom dashboard (with tags : “service”) exists and if yes, add it as the next row to the dashboard

Thanks in advance for any help!

'use strict';

// accessible variables in this scope
var window, document, ARGS, $, jQuery, moment, kbn;

return function(callback) {

// Setup some variables
var dashboard;

// Intialize a skeleton with nothing but a rows array and service object
dashboard = {
      rows : [],

// Set a title
dashboard.title = 'K8S ' + service;

// Set default time
// time can be overriden in the url using from/to parameters, but this is
// handled automatically in grafana core during dashboard initialization
dashboard.time = {
      from: "now-1h",
        to: "now"

dashboard.tags = [
dashboard.editable = true;

dashboard.links = [
      "asDropdown": false,
      "icon": "external link",
      "keepTime": true,
      "includeVars": true,
      "tags": [
      "title": "",
      "type": "dashboards"

var optional_rows = [];


    method: 'GET',
    url: '/'
  .done(function(result) {

  // custom rows
  for (var i in optional_rows){

    // when dashboard is composed call the callback
    // function and pass the dashboard




If you do a http request and fetch a dashboard I guess it would be possibly to parse that response and generate panels based on that data.