Sisense Community logo
    • Community Feedback
    • Chapters
    • Events
    • Forums
      • Help and How To
      • Product Feedback Forum
      • Strategy & Use Cases
    • Blogs
    • KB Docs
      • KB Docs
      • Add-Ons & Plug-Ins
      • APIs
      • Best Practices
      • Blox
      • CDT
      • Cloud Managed Service
      • Data Models
      • Data Sources
      • Embedding Analytics
      • How-Tos & FAQs
      • Onboarding
      • PySisense
      • Security
      • Sisense Administration
      • Sisense Intelligence & AI
      • Troubleshooting
      • Widget & Dashboard Scripts
    • Support
    • Learning
      • Sisense Academy: Free Courses and Certifications
      • Official Developer Documentation
      • Official Product Documentation
      • Official Sisense Youtube Channel
      • Sisense Compose SDK Playground
    • Use Case Gallery
    All PostsDiscussionsBlogsIdeasQuestions
    Leaderboards
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
    Discussions
    • Knowledge Base DocsChevronRightIcon
    • BloxChevronRightIcon
    Blox action initiating the elasticube build for Sisense on Linux

    Step-by-Step Guide:

    Prerequisites:

    • Blox is enabled in your Sisense instance
    • You have access to edit dashboards and create actions
    • You know the UUID (datamodelId) of the model you want to build

    1. Add a Blox widget to your dashboard

    To define and register a custom action, you must first create a Blox widget in a dashboard.

    1. Open your dashboard
    2. Click + Add Widget → Blox
    3. In the widget editor, add the following minimal configuration:

      {
      
        "style": "",
      
        "script": "",
      
        "title": "",
      
        "showCarousel": true,
      
        "body": [],
      
        "actions": []
      
      }
    4. Click Apply to save the widget.

    2. Create the custom action from the widget editor

    Now that the Blox widget is added, follow these steps to define the custom action:

    1. Click the pencil/edit icon on the Blox widget
    2. Go to the Actions tab
    3. Click the three-dot menu (⋮) in the top-right corner of the Actions tab
    4. Select “Create Action”

    This opens the action editor.

    3. Define the buildCube action

    Step 1: Set the action name and paste the code

    • Action name: buildCube
    • Language: JavaScript
    • Paste the following code:
    // JavaScript (Blox Action)
    const datamodelId = payload.data.datamodelId;
    const buildType = payload.data.buildType || "full";
    const schemaOrigin = payload.data.schemaOrigin || "latest";
    const rowLimit = payload.data.rowLimit != null ? payload.data.rowLimit : 0;
    
    const $internalHttp = prism.$injector.has("base.factories.internalHttp") ?
      prism.$injector.get("base.factories.internalHttp") : null;
    
    const ajaxConfig = {
      url: "/api/v2/builds",
      method: "POST",
      contentType: "application/json",
      accept: "*/*",
      headers: {
        "internal": "true"
      },
      data: JSON.stringify({
        datamodelId: datamodelId,
        buildType: buildType,
        schemaOrigin: schemaOrigin,
        rowLimit: rowLimit
      }),
      async: false
    };
    
    const httpPromise = $internalHttp ?
      $internalHttp(ajaxConfig, true) :
      $.ajax(ajaxConfig);
    
    if (httpPromise && httpPromise.then) {
      httpPromise
        .then(response => {
          console.log("Build task created successfully:", response);
        })
        .catch(error => {
          console.error("Failed to create build task:", error);
        });
    } else {
      console.error("HTTP request failed to initiate.");
    }
    

    Step 2: Define the action template

    In the Template tab of the same modal, paste the following JSON:

    {
    
      "type": "buildCube",
    
      "title": "title",
    
      "data": {
    
        "datamodelId": "datamodelId",
    
        "buildType": "buildType",
    
        "schemaOrigin": "schemaOrigin",
    
        "rowLimit": "0"
    
      }
    
    }

    Click Save to register the action.

    4. Use the action from a Blox widget

    After defining the action, you can call it from a widget using this configuration:

    {
    
      "style": "",
    
      "script": "",
    
      "title": "",
    
      "showCarousel": true,
    
      "body": [],
    
      "actions": [
    
        {
    
          "type": "buildCube",
    
          "title": "Build",
    
          "data": {
    
            "datamodelId": "8800cc3d-b12f-4fe9-962a-c0c2ff8f7e85"
    
          }
    
        }
    
      ]
    
    }

    This will display a “Build” button. When clicked, it triggers the buildCube action for the given model. You can extend the data block with:

    • "buildType" — full, schema_changes, by_table, publish
    • "schemaOrigin" — latest <strong>or running</strong> (for extract models)
    • "rowLimit" <strong>— a row limit integer (default: 0)</strong>

    Conclusion: 

    To trigger Elasticube builds in Sisense on Linux, you can define a reusable Blox action (buildCube) and call it from dashboards. This method simplifies model maintenance and enables users to initiate builds on demand, without needing direct access to the Data page or backend.

    References/Related Content

    Sisense REST API endpoint documentation
    Sisense BloX Custom Actions Guide


    Disclaimer: This post outlines a potential custom workaround for a specific use case or provides instructions regarding a specific task. The solution may not work in all scenarios or Sisense versions, so we strongly recommend testing it in your environment before deployment. If you require additional assistance with this, please don't hesitate to let us know.

    Taras Skvarko
    By
    Taras Skvarko
    Posted 1 year ago
                                           
             
    0 comments

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
                   
                                                                                     
    •                                                              
    •                                                              
    •