Dynamic Dropdown #indirect #substitute

I just imported an Excel Spreadsheet but one of my formulas did not come through – namely, =INDIRECT(SUBSTITUTE(fieldname," “,”_"))

The value of the previous field determines the single select options for the subsequent field. I notice another user posted this request last year, but for some reason the topic was closed a short time later.

Does anyone have a workaround?

:sweat_smile: Some of these threads indicate that “This topic was solved and automatically closed” – so dynamic dropdowns must have been enabled :slight_smile: I just haven’t found out how to do it yet.

1 Like

While this isn’t really satisfactory, here’s what I’m doing for now which at least enables me to move on to the next step, despite a jury-rigged style intermediary…

I have two single-select fields rather than one – with the first value in each dropdown indicating a type of categorically specific “null” – in essence, allowing me to refer to the alternate field containing the other dropdown. Not really elegant, but good enough for now.

PS - But AirTable Support Staff, please don’t count this as “solved” ! LOL :smiley:

1 Like

This Functionality is not possible with Airtable. There are some work arounds but they are fragile. I would send Airtable support an email to let them know you want this type of cascading/dynamic filtering functionality.

As someone here already pointed out, dynamic dropdowns are actually a thing as of recently, I’ve been using them for a while to teach regex to colleagues by breaking up a long regex patterns across numerous fields. Some exotic scenarios even allow you to load code via field names and are the only aspect of the solution that I’d describe as “fragile”, presumably because they were never meant to be used in such fashion.

Would you mind pointing us to a demo or example of this feature? What was the recent change that facilitated this functionality?

The base is client’s property so can’t share it without explicit consent. This should be enough to get you going, though, just consider the following way of populating fields:

image

the end result looks the same like just writing [0-9] into a single-line field, (times however many records you might have), right?

But here’s the real reason we’re doing it this way: modular regex invocations:

I found this approach to result in significantly easier debugging tasks and maintenance (this is part of a natural language processing pipeline with a data-to-text component, meaning things real crazy, real fast, and I need to be able to make sense of hundreds of fields at a glance) than relying on 50-line formulas, regardless of whether you’re inputting them directly or importing from an IDE.

The field names aren’t the most revealing in this example, but this particular setup started as an attempt to write (and teach) regex without having to fiddle with the claustrophobic formula field but while still getting real-time results.

The nested logic also works with both short and long text fields, as well as choice-based fields and links (it just outputs their visible string values to plaintext). The interpolation is pretty limited, however, and trying to drill deep into the concept will probably result in you slamming headfirst into a wall of technical debt.

For heavy - or rather: heavier - interpolation with acceptable performance (assuming that is what you’re really after), look no further than the scripting block/app itself. All you really need to internalize to get started is that:

let test = '## hello, airtable' + " and $goodbye"
let aloha = `${test}`
output.markdown(aloha)

… would output an h2-level subheader like this:

hello, airtable and $goodbye

Grave accents/backticks `` and the ${} template literal form that utilizes them are the key to making it work in this context. Because everything between the curly brackets gets evaluated on the condition that the result is returned as a string. Scaffolding prototypes this way is much quicker than fiddling with a bajillion dynamic fields but good luck debugging extra whitespaces in the scripting block at 5am, or so I hear.

This topic was solved and automatically closed 15 days after the last reply. New replies are no longer allowed.