This node allows you to customize data extraction and manipulation then return data in tabular form to the following node.
Example: Read tabular data from a file (e.g., CSV) and return it as a table or structured data.
var tableContent = FileUtil.readFile("d:\\tmp\\file.csv");
// Perform any required operations on the table
return tableContent;
Example: Retrieve data from API and return in Tabular format
// Retrieve exchange rates from the API
var request = HttpUtil.get("https://boi.org.il/PublicApi/GetExchangeRates");
var jsonContent = JsonUtil.parse(request.asString().getBody());
var exchanges = jsonContent.exchangeRates;
// Create a table to store the data
var table = SuiteTable.create("MyTable");
SuiteTable.addStringColumn(table, "key");
SuiteTable.addDoubleColumn(table, "rate");
SuiteTable.addStringColumn(table, "lastUpdate");
// Populate the table with data from the API
for (var i = 0; i < exchanges.size(); i++) {
var item = exchanges[i];
var key = item.key.asText();
var rate = item.currentExchangeRate.asDouble();
var date = item.lastUpdate.asText();
var row = {
"key": key,
"rate": rate,
"lastUpdate": date
};
SuiteTable.addRow(table, row);
}
// Filter table with some type of selection
var filteredTable = table.where(selection);
// Return the filtered table
return filteredTable;