Help

Save the date! Join us on October 16 for our Product Ops launch event. Register here.

Re: Script Request: Copy the value of a field to a Linked field in a table to perform a lookup in another table

4607 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Doug_Kaufman
5 - Automation Enthusiast
5 - Automation Enthusiast

Purpose:

In a table where the field is a “LINKED to record” field.

Many times the value for the LINKED field is a value in another text or formula field.

A script that can take the value of a string field, and insert that value to the LINKED To field so that the lookup is somewhat automatic. Currently the only way to do this is to manually do a copy/paste from one field to the LINKED Field.

I believe what would need to be done is -

  • Copy the table field from to a variable
  • Do a lookup in the LINKED Table
  • Insert the valid lookup into the LINKED TO Field
  • If there is an invalid look - then don’t display anything

ie.

Master Table
Phone # Link to Contacts via Phone Name Lookup
111-111-1111 111-111-1111 Abe Lincoln (This is the desired result)

Lookup Table
Phone # Name
111-111-1111 Abe Lincoln

18 Replies 18
Product_Novus
5 - Automation Enthusiast
5 - Automation Enthusiast

I’m looking to do the same thing! Copy and paste from a text/single-select/multi-select field to a linked field. I currently have to copy and paste manually, which works perfectly as expected but is inefficient.

Would really appreciate help here as well!

I would also love to be able to do this automatically.

Sam_Cederwall
7 - App Architect
7 - App Architect

Hello,

I saw this post last week but didn’t feel qualified to answer as I am just now beginning to learn JavaScript myself.

I wanted the same thing from a Script about a month ago and had some success so I thought I would share now and hopefully help some people out even though I myself, am no expert.

If I understand the specs correctly, this is the script will allow you to populated a linked field based on a match between two tables:

Hopefully this is clear enough to apply to your base! Please understand that there might be a more efficient way to do this, but I hope it helps.

Good luck!

Catherine_Garni
5 - Automation Enthusiast
5 - Automation Enthusiast

Hello,

I tried but It doesn’t work. I’m not a developer and I discover the Javascript with this new Airtable Block…
I would like to do this : copy to link
It would help me for many cases. I would greatly appreciate your help !

I’m trying to do the same. Got any new ideas?

I find a solution and will post it very soon.

Same problem… Catherine, any updates on the solution?

Hello,

I’m stuck on this topic as well. Tried running the script and I think it fails when there isn’t a match, which sometimes happens at least in my use case.

Can somebody help? It’s really quite a big blocker not being able to use a formula as a link?

Cheers,
Alivia

Christian_Heins
5 - Automation Enthusiast
5 - Automation Enthusiast

Solution: