Hey
@Patsy_Count
! This is currently being worked on, but in the meantime, would this workaround be helpful?
http://community.retool.com/t/table-filter-by-a-custom-column/9230
Let me know if you have any questions at all!
Hey Patsy! The solution in that thread should work for any data sources—the only caveat being the very first line of the code. If your data is already an array of objects (which MongoDB data does get returned as), then you don't need to convert it into one.
You'll need to create a JS transformer and run this code
const data = {{ yourMongoQuery.data }}
data.forEach(row => { row.new_row = row.rating * 100 return row; })
return data;
Then in your table, you'll just use the JS transformer.value as the data source instead of your original Mongo query!
To answer your second question, the table.columnMappers property gets populated by Custom Column data so it can be helpful if you need to access your Custom Column data; otherwise, Custom Columns are just for display only and can't really be accessed anywhere else.
Let me know if you have any other questions!
const data = {{ yourMongoQuery.data }}
data.forEach(row => { row.new_row = row.rating * 100 return row; })
return data;
Is it possible to specify column order? What if I wanted to insert new_row after my id column?