Hi,
it works fine with the help of dynamic variables and some actions.
The key is that "\n" in the expression of a Dynamic String Variable / Text Expression is interpreted fine when used as source for the Markdown.
Ingredients:
mdTableColumn1Rows, mdTableColumn2Rows: string list variables (input) with the entries for each column.
mdTableFinal : string variable, to hold the final Markdown.
mdTableHeader : dynamic string variable, expr. " | Name | Age | \n | --- | --- | \n".
mdRowIndex : numeric variable.
A custom action which initializes building the Markdown table, could be triggered by a button, on page load...:

The action mdAddRow is adding the rows from the input arrays:

As last step, the action calls itself recursively. Wrapped in the if-statement, this stops when no more rows from the input array are left to be processed.
NOTE: This works in general, but I don't know if recursion depth (= no. of records) has its limits...
------------------------------
Christian Karpp
Principal PS Consultant
------------------------------
Original Message:
Sent: 10-27-2025 13:18
From: Christian Karpp
Subject: Displaying array as table in script
Hi, regarding array size - you can get it inside the script using a numeric dynamic variable with the expression length( {{myListVariable}} )
------------------------------
Christian Karpp
Principal PS Consultant
Original Message:
Sent: 10-24-2025 16:27
From: Fernando Sotto dos Santos
Subject: Displaying array as table in script
Uma abordagem alternativa - embora mais manual - seria iterar sobre o array diretamente no Architect, armazenando os elementos em variáveis individuais. Posteriormente, essas variáveis poderiam ser referenciadas no Agent Script como dados do participante, permitindo a construção de uma tabela dinâmica com base no volume do array.
Essa solução não é escalável para arrays grandes, mas pode funcionar como uma estratégia paliativa em cenários onde o número de elementos é previsível ou limitado. Vale lembrar que o componente Markdown no Agent Script tem limitações na renderização dinâmica, especialmente quando se trata de estruturas como tabelas baseadas em variáveis compostas.
An alternative - albeit more manual - approach would be to iterate through the array within Architect and store each element in individual participant data variables. These variables could then be referenced in the Agent Script to construct a table-like structure.
While this method doesn't fully solve the dynamic rendering challenge, it can serve as a workaround in scenarios where the array size is predictable or limited. Keep in mind that the Markdown component in Agent Scripts has limitations when it comes to rendering dynamic tables based on variable arrays.
------------------------------
Fernando Sotto dos Santos
Consultor
Original Message:
Sent: 10-22-2025 10:13
From: Armands Bunkovskis
Subject: Displaying array as table in script
Hi!
I'm struggling to understand how do dynamically display table in agent script based on an array variable in architect. As i understand we could use markdown component in script, but I can not find a way to construct a variable in a way that it would actually display as a table. Has anyone experience and some examples how that coud be obtained.
Thanks in advance
#Scripts
------------------------------
Armands Bunkovskis
Adventus Solutions Sia
------------------------------