-
Goal: I'm building a list view of customer activity and expecting to display the activity type in tags format
-
Steps: I have a list view that repeats the latest 5 customer activities. It works well.
however when I try to display the activity type in tag format, the behavior is confusing
- Details: Basically, when I the tags component and link it to my activity query, and map the results to the tags component, instead of getting the activity type per customer displayed as tag, retool is almost like creating a set of all unique activity types from each activity and displays them as tags. No matter what I do the component treats the value as an array and displays three tags instead of the relevant activity type only.
I'm at a loss, I tried changing the query output using formatAsArray and formatAsObject but that didn't help.
In my tags component I see this
My SQL is simply getting the last five activities
SELECT ca.title, ca.body, ca.id AS activity_id, ca.created_at, u.name AS csm_name, u.email AS csm_email, u.id AS csm_id, ca.type
from customer_activities ca
LEFT JOIN users u
ON u.id = ca.csm_id
WHERE
ca.customer_id = '{{ customer_list.selectedRowKey }}'
ORDER BY ca.created_at desc
LIMIT 5
I saw this in the retool doc page, so it can be done, however I'm not sure if they're using mapped values or manual values in this image