Aug 18, 2020 06:36 PM
I’m setting up a rollup field to concatenate record IDs for general items that match a set of filters. There is a form input box to accept plain text, but it does not accept column names or cells as inputs. Is there a way to make it do that similar to a formula?
Aug 18, 2020 07:06 PM
Not directly. That field is where you specify some condition you want to check for (e.g. contains) related to the value of that field (e.g. {Name}
) in the linked record. It must be a literal value. If you want to use multiple fields from the target table as part of the condition, you could add formula fields on that target table for those deeper tests, and then have the conditional setup check the formula field’s output.
Aug 19, 2020 09:25 AM
The problem with having the formulas within the target table is that they need to pull inputs from the table doing the lookup. So either way I do it, I would probably need some way to filter dynamically with cell values.
I was thinking of using formulas to parse an array, but I do not know of a way to iterate or repeat a formula across many records in a text array.
Aug 19, 2020 09:30 AM
Sadly, that’s not possible. Airtable’s functions don’t offer array iteration support. If you need to get that deep into the data, you’ll need to consider scripting, which can pull data from any part of your base to do the job. If you’d like any help in that regard, just holler.
Aug 19, 2020 09:49 AM
Yes, I would like to figure this out as soon as possible. Do you have a template for that type of script in the scripting block? I have 2-3 filter parameters that I want to apply, and if I could parse the text array, I considered applying them with the URL model where the lookup field would read like this: rec00000000&Topping?=‘ketchup’&Food?=Burger . The question is how to parse that when there are up to 300 of those in one comma-separated array.
Aug 19, 2020 10:10 AM
Unfortunately I don’t have a template for something like that, as I haven’t built that type of setup before. Based on your description, it sounds like this script would need to be pretty closely tailored to your specific setup, so I’m not sure that a template would even be helpful. I’ll send you a DM shortly to discuss some possible options.
Aug 19, 2020 10:17 AM
It’s not custom, I was just providing an example for visualization. This is a feature that would have broad benefits for people looking to get more power out of Airtable’s filters.
Aug 19, 2020 10:20 AM
Understood. I still can’t put together a template without a more specific example, though. Can you break down what you’re looking to do in more detail?
Aug 19, 2020 11:06 AM
Of course, I’ll show you a simple example to try to clarify.
When I use the term ‘relational’, I’m referring to linked fields connected to another base.
Let me know if there are any key details missing.
Aug 24, 2020 05:27 PM
I’ve read through this description several times. While some parts are clicking, others aren’t, and I think the main part that’s not quite clicking for me is the end goal of this setup. After reading in your other thread that you’re building an API-driven tool, I’m not sure why you’re trying to create a filtering system inside of Airtable itself when the API code would allow you to do the filtering you need much more easily.
Circling back to the script option that I was proposing, that’s also not going to work with an API-driven tool. Scripts in the Scripting block must be run manually from the Airtable UI. They can’t be triggered by the API. While Airtable’s automations can do things without the UI, there’s a delay in the activation of their scripts. And again, if you’re making an API-driven tool, then you’ll have far greater flexibility to do the kind of filtering that you want in the code itself compared to trying to wrangle Airtable’s features to achieve the output you seek.