Hi, title explains, I want to populate the timeline component with a query result, but it keeps asking for an array and I can't call the query. What is the correct way to do it?
So my query is:
SELECT ARRAY_AGG(type || ' ' || notes || ' ' || created_by) AS text_array
FROM opportunities_history
WHERE opportunities_history.fk_opportunity_history_oportunities = {{table1.selectedRow.opportunity_id}}
and it returns this perfect array called text_array. but in the component I use:
[{{getOpHistoric.text_array}}]
And it doesn't work.
Something like?
{{ getOpHistoric.data.text_array[0]}}
or use a query transformer.
return formatDataAsArray(data)[0]
return data.text_array[0]
2 Likes
First option works fine! Thanks a lot!
1 Like