Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Unable to retrieve DataTable enties:"showbrief": false Query paramaeter not working for get /api/v2/flows/datatables/{datatableId}/rows

    Posted 04-28-2025 19:25

    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
    ------------------------------


  • 2.  RE: Unable to retrieve DataTable enties:"showbrief": false Query paramaeter not working for get /api/v2/flows/datatables/{datatableId}/rows

    Posted 04-29-2025 11:36

    Hello,

    I have created an "ERS_Agent_Assignment" table with (key, primaryId, secondaryId, timestamp) fields and tried the functions you have posted above (connecting to my Genesys Cloud org/environment.

    And it is working fine for me.

    Loaded row: {

      secondaryId: '7bcb11cf-59b1-416f-aa50-ed541bcb611d',

      primaryId: 'fb860502-9814-41d6-b5a7-e1fa112ddf24',

      key: 'ERS',

      timestamp: '2025-04-07T23:39:42.504Z'

    }

    Not knowing all details of your code (what you haven't posted above):

    Are you using a proxy (or gateway) or connecting your apiClient directly to the Genesys Cloud org?

    Are you calling the getTableIdByName function somewhere else (before) in your code, for a different table name?

    What version of the Javascript/Node Platform API Client SDK are you using?

    Can you try to run the query from API Explorer to see if you get the same result - GET /api/v2/flows/datatables/{datatableId}/rows/{rowId} ?

    If you have Genesys Cloud CLI or Postman - can you try to run the query with the same OAuth Client Credentials than the one you are using in your code?

    Regards,



    ------------------------------
    Jerome Saint-Marc
    Senior Development Support Engineer
    ------------------------------



  • 3.  RE: Unable to retrieve DataTable enties:"showbrief": false Query paramaeter not working for get /api/v2/flows/datatables/{datatableId}/rows

    Posted 04-29-2025 20:36

    Hi Jerome,

    I am not using a proxy and I am connecting directly to the org through an implicit grant.

    I am calling the getTableIdByName in another function and the code snippet is already provided above. It is retrieving the correct table and the Key row as well but no other columns.
    I tried it in API Explorer, and it is working. I would like to know why it is not working in my code.


    ------------------------------
    Jaison Thomas
    Senior Solutions Architect
    ------------------------------



  • 4.  RE: Unable to retrieve DataTable enties:"showbrief": false Query paramaeter not working for get /api/v2/flows/datatables/{datatableId}/rows
    Best Answer

    Posted 04-30-2025 08:04

    Hello,

    The problem is coming from your Javascript SDK version. Version 27 is too old. The current/latest version is 220.0.0

    Please update your Javascript SDK version and check if it is resolved (it should - I can reproduce your issue with version 27).

    Regards,



    ------------------------------
    Jerome Saint-Marc
    Senior Development Support Engineer
    ------------------------------



  • 5.  RE: Unable to retrieve DataTable enties:"showbrief": false Query paramaeter not working for get /api/v2/flows/datatables/{datatableId}/rows

    Posted 05-05-2025 19:27

    Thanks Jerome. 



    ------------------------------
    JT
    ------------------------------