I have posted this 20 days ago but unfortunately no response and reposting now. Could you please throw some light on this topic?
I am unable to get the all the columns from a Datatable when I set the showbrief flag to false. I can only get the key value from the table with the following fields:
id:ERS, primaryId:fb860502-9814-41d6-b5a7-e1fa112ddf24, secondaryId:7bcb11cf-59b1-416f-aa50-ed541bcb611d, timestamp:2025-04-07T23:39:42.504Z.
But it only returns the key column value:
{
"key": "ERS"
}.
Please find the code below:
const tableName = 'ERS_Agent_Assignment';
async function getCurrentAssignment(tableName) {
const architectApi = new platformClient.ArchitectApi();
const tableId = await getTableIdByName(tableName);
if (!tableId) return null;
try {
const row = await architectApi.getFlowsDatatableRow(tableId, 'ERS', { showbrief: false });
console.log('Loaded row:', row);
console.log(`getFlowsDatatableRow success! data: ${JSON.stringify(row, null, 2)}`);
//console.log('Row.values:', row?.values);
return row;//?.values || null; // safely return null if values is missing
} catch (err) {
console.warn('No assignment row found:', err);
return null;
}
}
async function getTableIdByName(tableName) {
if (cachedTableId) {
return cachedTableId; // return the cached ID if we already found it
}
const architectApi = new platformClient.ArchitectApi();
try {
const response = await architectApi.getFlowsDatatables({ pageSize: 100 });
const match = response.entities.find(table => table.name === tableName);
if (match) {
console.log(`Found table "${tableName}" → ID: ${match.id}`);
cachedTableId = match.id; // cache it for future use
return cachedTableId;
}
else {
console.error(`Table "${tableName}" not found.`);
return null;
}
}
catch (error) {
console.error('Error retrieving table list:', error);
return null;
}
}
#PlatformAPI------------------------------
Jaison Thomas
Senior Solutions Architect
------------------------------