Getting data library report data from within your skill code
// Ensure you import DataLibraryPowersimport { DataLibraryPowers } from"@andi/powers";
// getting data library report rows assuming that data library report has these fields as headertype MyRow = {
id: string;
city: string;
zip: string;
};
const rows = await DataLibraryPowers.get<MyRow>("my-test-report-key");
// access first rowconst id = rows[0].id;
// get data library report rows as dynamic type and then refer a particular column that may have space in it's nameconst rows = await DataLibraryPowers.get<any>("my-test-report-key");
* // access first rowconst data = rows[0]["my column name"];
Getting data library report visualization from within your skill code
// Ensure you import DataLibraryPowersimport { DataLibraryPowers } from"@andi/powers";
// get data library report visualization, if no visualization is found it returns null// visualization is in html string formatconst html = await DataLibraryPowers.getVisualization("my-test-report-key");
Retrieve data from data library.
{TypeError} when
reportKey
is missing.Getting data library report data from within your skill code
// Ensure you import DataLibraryPowers import { DataLibraryPowers } from "@andi/powers"; // getting data library report rows assuming that data library report has these fields as header type MyRow = { id: string; city: string; zip: string; }; const rows = await DataLibraryPowers.get<MyRow>("my-test-report-key"); // access first row const id = rows[0].id; // get data library report rows as dynamic type and then refer a particular column that may have space in it's name const rows = await DataLibraryPowers.get<any>("my-test-report-key"); * // access first row const data = rows[0]["my column name"];