-
Goal: I want to use {{i}} within a listview to return a description and reference data stored in various sources.
-
Steps: I've been able to debug that {{i}} does render properly when I'm not using a transformer in a listview. However, when I want to use the value i to transform into a specific value (see the screenshot red box), it doesn't work. When I just reference i directly, it works (blue box).
-
Details: Here's a snippet of my transformer (edit: transformer not in the Retool term, but referring to the code snippet below I have within my component):
{{tempWasteRows.value.slice(i * 10, (i === 0 ? (i * 10) + 4 : (i * 10) + 10)).map((row, index) => `9B${index + 1}: ` + [
(row.erg ? "ERG#: " + row.erg : ""),
(row.codes?.slice(6, row.codes?.length).length > 0 ? `${row.codes?.slice(6, row.codes?.length).join(", ")}` : ""),
(row.profile_num?.length > 0 ? `${row.profile_num}` : ""),
(row.container_size?.length > 0 ? `${row.container_size}` : ""),
(row.additional_info?.length > 0 ? `${row.additional_info}` : ""),
(row.th ? "TOTAL HALOGEN:" : "")
].filter(Boolean).join(", ").toUpperCase()).join("\n") }}
Why is this not working and how can I use i (in the screenshot example above, it should be the value 1) in my transformer?