Note: I have had a look at the other threads on this topic, but I'm still struggling.
It's my first time trying to use data action with a data table to populate Architect variables and I need some help to understand how to build the output contract and Response/translation for 'custom' data tables.
Using /api/v2/flows/datatables/${input.datatableid}/rows?pageSize=500&showbrief=false
Result JSON:
{
"entities": [
{
"PromptVerbiage": "This is test prompt 1",
"key": "TestPrompt1"
},
{
"PromptVerbiage": "This is test prompt 2",
"key": "TestPrompt2"
}
],
"pageSize": 500,
"pageNumber": 1,
"total": 2,
"pageCount": 1
}
How would one build the output contract and response to get the data to variables that you can query?
The data table won't have hundreds of ROWS.
My thinking is that one needs an array variable with each row as a JSON Object with the two values.
You will then have a couple of parallel lists, entities.PromptVerbiage and entities.key that you can iterate through in architect to accomplish your goal.
I suggest this approach as otherwise you are going to end up with failures because data actions are pretty picky about what can be returned when the response is flattened (which is required by architect).
A couple of other things:
I modified your posts to use the </> button on your configuration examples instead of the double quotes in order to improve how they are rendered.
Second, there is a built in "Data Table Lookup" action in architect, that I assume isn't meeting your needs. Please post your use case to Genesys Cloud Ideas Portal so that your needs can ideally be met by built-in architect capabilities.
The use case we are looking for here is to 'load' all the 'prompts' from the Datatable in one go to then be able to use the values in the flow for TTS responses and not needing to call Datatable lookup multiple times through the flow.
With this solution customers can update the text on a datatable and not need to have "technical" knowledge or access to architect to update TTS prompts.