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

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

3 Likes

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!

1 Like

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

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!

1 Like

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 :


It would help me for many cases. I would greatly appreciate your help !

1 Like

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?