Adding logic to map a custom value in table

I want to use JS like this in a table to render the correct value for each row:

{{moment(table9.selectedRow.due_date, 'YYYY-MM-DD').isBefore(moment(), 'day') ? 'ALERT' : ''}}

This works if I click on a row that satisfies the condition (due date is in the past) and shows "ALERT" in ALL rows instead of just the rows that meet this condition.

I need to replace selectedRow with something so that the js and value for that row is independent of what's actually selected.

Is that possible?

Note that using

{{moment(table9.data[i].due_date, 'YYYY-MM-DD').isBefore(moment(), 'day') ? 'ALERT' : ''}}

Isn't an option because the value for due_date is one thing, but the MAPPED value is a random date. I'm overriding the actual data source, so maybe the question is if I can get the mapped value for the due_date column to use in this JS

Hey @hess411!

Would it work for you to use a status indicator add-on for your due date column?

What column type are you currently using, and is there any additional functionality you would like from it?


Thanks. That's an interesting add-on I didn't realized was possible. I tried this and got the alert working, but when I remove the value form that column, the ALERT disappears also. How do I hide the value (true/false) but show the ALERT as appropriate?

Looks like a hack is to make the format something like "icon" that won't render properly, but wondering if there's a non-hacky version.

The intention was to render it on the Due Date column itself!

For some additional context would you mind sharing where you're getting the mapped values from? Is there an outside data source you can reference or is there a particular reason they're being generated where they are?