Skip to content
English
  • There are no suggestions because the search field is empty.

Sync data and embed custom reports from BI tools

Sync ITONICS data to a BI tool such as Looker Studio, and embed the report in a workspace.

Sync ITONICS data to a BI tool through the ITONICS Cloud API, and embed the report you build there in a workspace, under More Tools > Report. For the kinds of reports, see Overview of reports.

Before you start

  • To sync data, have an integration API key that can view the elements of the workspace (see Create an integration API key) and the workspace's API URL: https://{your-domain}/rest/external/odata/v2/{spaceUri}. To get the SpaceURI, go to Organization settings > Embed & External access, and click Copy URI next to the workspace name.
  • For Power BI, load the data as described in Connect Power BI.

Embed a BI report in ITONICS

Sync data to Google Looker Studio and embed the report

  1. Create a blank Google Sheet with your work account, and go to Extensions > Apps Script.

    A blank Apps Script project opens.

    Google Sheets with the Extensions menu open and Apps Script highlighted
  2. Replace the code in the editor with the script below these steps, enter your API URL as BASE_URL, and replace INSERT HERE YOUR API KEY with your API key.

    To get only some elements, change FILTER_QUERY. To write to another sheet, change sheetName. Instead of writing the key into the script, you can store it in the script properties as ITONICS_API_KEY.

  3. Click Run.

    The script loads all elements of the workspace page by page into the sheet, one row per element and one column per property of all element types in the result. In a large workspace, that can be many columns.

  4. To keep the data up to date, go to Triggers > Add Trigger, select the function fetchApiToSheet and a time-driven trigger, for example a daily timer at midnight, and click Save.

    Add Trigger dialog in Apps Script with the function fetchApiToSheet, a time-driven day timer, and midnight to 1am
  5. In Looker Studio, create a Blank Report, select Add data to report > Google Sheets, and select your sheet.

    Build the report from the synced data.

  6. Share the report with the people who should see it.

    Like a Google Doc, you share the report with email addresses. It isn't public unless you make it public.

  7. Go to File > Embed report, select Embed URL, and copy the URL.

    Embed Report dialog in Looker Studio with Embed URL selected and an example embed URL
  8. In ITONICS, go to More Tools > Report, click the name of the report at the top, and select Embed new Report.

    If the workspace has no report yet, click Embed Report.

  9. Enter a Title, paste the URL under Report URL, and turn on Make publicly available if everyone in the workspace should find the report.

    The URL must start with https. The title can have up to 120 characters.

    Embed Report dialog in ITONICS over an embedded report, with the fields Title and Report URL, the Make publicly available switch, and the Embed Report button
  10. Click Embed Report.

    The report appears. Depending on its settings, people may have to sign in with their Google account and need view access to see it.

Script for step 2:

Apps Script

function fetchApiToSheet() {
// --- Config (mirror: URL & FILTER_QUERY) ---
const BASE_URL = "https://{your-domain}/rest/external/odata/v2/{spaceUri}";
const FILTER_QUERY = "/elements?$top=100"; // or e.g. "/elements?$filter=...&$top=100"
const FIRST_URL = BASE_URL + FILTER_QUERY;
// Prefer storing token in Script Properties:
// PropertiesService.getScriptProperties().setProperty("ITONICS_API_KEY", "...");
const token =
PropertiesService.getScriptProperties().getProperty("ITONICS_API_KEY") ||
"INSERT HERE YOUR API KEY";
const ss = SpreadsheetApp.getActive();
const sheetName = "api_data";
const sheet = ss.getSheetByName(sheetName) || ss.insertSheet(sheetName);
sheet.clear();
// --- 1) Pagination: fetch all pages ---
const allElements = [];
let nextUrl = FIRST_URL;
let safetyCounter = 0;
const MAX_PAGES = 1000; // safety guard
while (nextUrl && safetyCounter < MAX_PAGES) {
safetyCounter++;
const page = fetchPage_(nextUrl, token);
if (!page) break;
// Mirror PowerBI: elements + nextLink (but be tolerant to OData shapes)
const elements = page.elements || page.items || page.value || [];
if (Array.isArray(elements) && elements.length) {
allElements.push(...elements);
}
nextUrl = page.nextLink || page["@odata.nextLink"] || null;
}
if (!allElements.length) {
sheet.getRange(1, 1).setValue("No elements returned (or API shape mismatch).");
return;
}
// --- 2) ROBUST expansion: union of all keys across all rows ---
const headers = unionKeys_(allElements); // like AllColumnNames in PowerBI
sheet.getRange(1, 1, 1, headers.length).setValues([headers]);
// --- 3) Write rows ---
const rows = allElements.map(el =>
headers.map(h => normalizeCell_(el[h]))
);
sheet.getRange(2, 1, rows.length, headers.length).setValues(rows);
// Optional: basic formatting
sheet.setFrozenRows(1);
sheet.autoResizeColumns(1, headers.length);
}
/**
* Fetches a single page and returns parsed JSON.
*/
function fetchPage_(url, token) {
const res = UrlFetchApp.fetch(url, {
method: "get",
muteHttpExceptions: true,
headers: { Authorization: "ApiKey " + token }
});
const code = res.getResponseCode();
const text = res.getContentText();
if (code < 200 || code >= 300) {
// Write something helpful in logs for debugging
console.error("HTTP " + code + " for " + url + ": " + text);
return null;
}
try {
return JSON.parse(text);
} catch (e) {
console.error("JSON parse error for " + url + ": " + e + "\nBody:\n" + text);
return null;
}
}
/**
* Returns union of keys over all objects in the array (top-level only),
* matching the PowerBI "scan all rows" behavior.
*/
function unionKeys_(objects) {
const seen = new Set();
objects.forEach(obj => {
if (obj && typeof obj === "object" && !Array.isArray(obj)) {
Object.keys(obj).forEach(k => seen.add(k));
}
});
return Array.from(seen);
}
/**
* Makes values sheet-safe:
* - primitives stay as-is
* - objects/arrays become JSON strings
* - null/undefined -> empty cell
* - dates: if API gives ISO strings, you can leave them as string or parse (kept as string here)
*/
function normalizeCell_(value) {
if (value === null || value === undefined) return "";
const t = typeof value;
if (t === "string" || t === "number" || t === "boolean") return value;
// object/array -> JSON
try {
return JSON.stringify(value);
} catch (e) {
return String(value);
}
}

Embed a report from another BI tool

  1. Copy the embed URL of your report in your BI tool, for example Power BI, Google Data Studio, Oracle, or Tableau.

    In the Power BI service, go to File > Embed report > Website or portal, and copy the link.

  2. In ITONICS, go to More Tools > Report, click the name of the report at the top, and select Embed new Report.

    If the workspace has no report yet, click Embed Report.

  3. Enter a Title, paste the URL under Report URL, and turn on Make publicly available if everyone in the workspace should find the report.

    The URL must start with https. The title can have up to 120 characters.

  4. Click Embed Report.

    The report appears. Depending on its settings, people may have to sign in to the BI tool, for example with their Microsoft account, to see it.

Note: Looker Studio is a freemium service, so API quotas or automatic refreshes may need a paid subscription. Google and other BI providers may change their licenses and these steps.

Result

The report opens under More Tools > Report, and you can switch to it from the report name at the top. To edit, share, or delete it, see Create and manage reports.