Hi, I keep running into situations where I need to determine which of a series of values another look-up column has selected. For example:
SwitchIf(
thisRow.Frequency.toText()="One-time", ...,
thisRow.Frequency.toText()="Monthly", ...,
thisRow.Frequency.toText()="Quarterly", ...,
thisRow.Frequency.toText()="Yearly", ...,
)
Using the toText()
method feels very brittle. Ideally I’d like the flexibility to check both by value (as I’m doing here) and by reference so that if the options label text changes, the linkage changes along with it (as is the case when columns are renamed).
Any guidance on the best practice for comparing by reference instead of by value?
In a pseudo-Coda-ese, I’d want a reference comparison akin to:
SwitchIf(
thisRow.Frequency=Frequency#[One-time], ...,
thisRow.Frequency.toText()=Frequency#Monthly, ...,
thisRow.Frequency.toText()=Frequency#Quarterly, ...,
thisRow.Frequency.toText()=Frequency#Yearly, ...,
)
Where the # symbol reflects that I’m referring to the display value of a specific row in the Frequency table, and that if the display value changes this formula would update accordingly (like columns do) and won’t break.