When I did this in a Script - I think you are working in Architect - I had to create a Data Action to use the Genesys Cloud API to get all the rows in a table. In the script, you can run the data action on load and assign the arrays that are an output of the Data Action to a list of strings variable. So, if you have two columns (e.g., Key, Value), you can create two list of strings variables to hold the Key values and the Value values.
The GET Request URL Template is /api/v2/flows/datatables/${input.datatableId}/rows?pageSize=500&showbrief=false
The input is the data table ID
The output is:
{
"type": "object",
"additionalProperties": true,
"properties": {
"QueueInfo": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true,
"properties": {
"Key": {
"type": "string"
},
"Valuel": {
"type": "string"
}
}
}
}
}
}
Admittedly, it has been a while since I built this, but please provide some additional details. Are you working in Architect or in Scripts?
------------------------------
Dan Fontaine
C1
------------------------------
Original Message:
Sent: 05-12-2025 16:35
From: Rudy Reinold
Subject: Creating a collections variable using a loop reading a data table
Hi all, I struggle to generate a string collections variable based on the returned variable from a data table I retrieve with a loop after determining the table length.
How do I build the string collection variable? I tried to use the make list, but that requires to define the amount of entries prior to the data table read and the data table length does vary. so basically when the list is 4 entries I expect "variableName, item 1, item 2, item 3, item 4" and when it is just one entry i expect "variableName, item 1"
I've been breaking my head on this for the past few days any suggestions appriciated.
#ArchitectureandDesign
#Unsure/Other
------------------------------
Ruud Reinold
BNP Paribas Personal Finance UK
------------------------------