-
Goal: I have column A, B, and C in my table component table1.
-Columns B and C are also calculated columns. -
I want to check a condition and add a new column D i.e. if A>20 then D= B+C else D= B*C.
-
Steps: I tried building the new custom column and populating it using transformer but this isn't working.
rough transformer code.
const newvalue = formatDataAsArray(table1.data).map(row => ({
...row,
D: row.A > 20 ? row.B + row.C : row.B * row.C
}));
return newvalue;
In the value section of the table component, what should I add here ?
transformer.data[i].newvalue -
Details: We are on self-hosted retool.
Could you please help if this is the right approach or I need to change something ?