Help

Re: Wondering if this is possible

4699 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Valentin_GUENIC
6 - Interface Innovator
6 - Interface Innovator

Hi everyone,

I used a very painfull and well known here workaround until now to update the listing of a (target) linked field depending on the selection of another linked field.
But, I have a premium account and access to scripting.
I wonder if it’s possible to alter a view of the target linked field with a filter based on a common field value (existing in both tables) (and maybe other things but for instance just this).
I was thinking of it because we can restrict a linked field by a view.

In summary, it needs:

  • know what is the value in the first linked field
  • get the value of the common field
  • alter the view of the target field by filtering with the previous common field value

So, is it doable with scripting ?
Thanks a lot for your thoughts.

10 Replies 10

Scripting cannot alter the configuration of a view. At best it can alter the value of a field for records in a view. For example you could have a view filtered by a checkbox and then you can have the script set or clear that checkbox for all records in the table, depending on the value in you common field.

But this workflow seems cumbersome. You would have to click a button to run the script, and then click in the linked record field to add the new record. There would be less back-and-forth if the user selected the new linked record in the script.

Thanks @kuovonne for this feedback.
I really thought it was possible to alter a view.
I forgot to mention that it would be nice if the script could run on user action. But maybe it’s not possible too.
It’s a shame that a functionnality (interdependent fields behavior / conditionnal fields values) is missing especially when a lot of users asked for it.

Still looking for a straight solution that don’t require junction tables, extra fields and is usable in more than one record at a time.

Hi,
t depends what you considering “alter”. you can change # of records in a view via script, if the view depending on filter. But you can’t change it in “vertical” axis (at least without bulky workaround

Everything you mentioned is doable, and the inability to alter view configurations is a mild inconvenience at best - Airtable views are nothing but fancy Array.prototype.filters.

But as Kuovonne already suggested, you might want to rethink what exactly it is you’re trying to do here. What’s the end goal? Or at least the criteria for surfacing the desired records?

You could go a straight scripting route for picking records. Have the script filter the available records based on whatever criteria you want and the have the user add records in scripting app. No extra junction tables or fields. Usable by multiple people for different records at the same time. I’ve written multiple scripts for clients that does this.

Rearranging linked records and deleting individual linked records is a bit of a pain in scripting due to the limits of the user interface, so you might want to keep doing those in the regular user interface.

Well I’m curious about this. But I’m no developer :’(
Do you have an example of a script which could filter a field based on user’s selection in another field?

No, I do not have a sample script to give away, but I do write scripts that work as I described for clients. If you are interested in hiring me to write a script, you can book an appointment.

We are a small non-profit association and our budget don’t allow us to hire someone on these questions. That’s why we are trying to figure out by ourselves or with a little help of the community.
Thanks for the proposal.

Yeah, creating complex user interfaces inside the Scripting block is extremely difficult because of the security restrictions. So, while it can be done, this is pretty deep in the work-for-hire territory. Sounds like an afternoon’s of work at least. The alternative is to get stuck in learning JS for a couple of months.

But while you can’t alter views directly, the aforementioned direct route does sound like the optimal approach. Or just poll the same records view filters poll and update them, thus altering their contents indirectly.

This script follows that line of thinking to manipulate the contents of a simpler view. One that contains only a single record.