Problem update row in datatable

Hello everyone,

I m trying to develop a custom client application integration , and i need to PUT and Create a row in dataTable.

When i try to put, i have an error :

{
"message": "the event input has no valid 'item' element.",
"code": "flows.datatables.syntax.error",
"status": 400,
"messageParams": {},
"contextId": "81a78a0a-d4f3-4e8d-aeef-5311fccb1622",
"details": [],
"errors": []
}

this is my syntaxe of the function that i use :

function updateRowCalendarExcept(XXX, XXX, XXX, XXX, XXX, XXX){

let datatableId = "XXX"; // String | id of datatable FERMETURE_EXCEPTIONNELLE
let rowId = "XXX"; // String | the key for the row
let opts = {
  "Calendrier Fermeture Exceptionnel": "XXX",
  "Active Message Exceptionnel Prompt": "XXX",
  "Message Fermeture Exceptionnel": "XXX",
  "Date Début": "XXX",
  "Date Fin": "XXX",
  "Active Message Exceptionnel TTS": "XXX",
  "Message Fermeture Exceptionnel TTS": "XXX",
  "key": "XXX"
};
    
    // Update a row entry
 apiInstance.putFlowsDatatableRow(datatableId, rowId, opts)
  .then((data) => {
      console.log(`putFlowsDatatableRow success! data: ${JSON.stringify(data, null, 2)}`);
  })
  .catch((err) => {
     // if not key not existing, Create New Row In Datatable 
      createNewRowCalendarExcept(nameService, activePrompt, activeTTS, startDate, endDate, message);
      console.log("There was a failure calling putFlowsDatatableRow");
      console.error(err);
  });

}

For information : when i try to use the PostAPI, it works without a problem.

Hope you can get me some help :slight_smile:

Thanks in advance for any help provided and have a great day everyone!!

Hello,

The problem comes from your opts parameter.
The putFlowsDatatableRow needs an object with top level attribute = "body".
It shows up in the Javascript SDK Invocations section of this endpoint.

let opts = {
  "body": {
    "Calendrier Fermeture Exceptionnel": "XXX",
    "Active Message Exceptionnel Prompt": "XXX",
    "Message Fermeture Exceptionnel": "XXX",
    "Date Début": "XXX",
    "Date Fin": "XXX",
    "Active Message Exceptionnel TTS": "XXX",
    "Message Fermeture Exceptionnel TTS": "XXX",
    "key": "XXX"
  }
};

Regards,

Thank you @Jerome.Saint-Marc ! it works :slight_smile:

I m new in working with the API Genesys Cloud :slight_smile:

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.