Skip to main content

Hello, 

 

I am trying to write a script that will automatically match records. The Base set up is as follows. Table 1: Contacts. Table 2: Has. Table 3: Needs. Table 4: Matches. Contacts and Matches are self explanatory. The Needs table consists of “Buy Boxes” for real estate investors. i.e. Property type, max price, number of bedrooms, state, city, etc. The Has table is where new opportunities are entered. The goal of the script is to then automatically match new entries in the Has table with open Buy Boxes in the Needs table, then score the matches based on the number of criteria that match, different criteria will have different weights. Null in either Has or Needs table should not effect the result. 

 

I am having a lot of trouble with this, as there are many variables in the Needs section. 

Hey ​@AdamF2377!

I built a similar matchmaking system for Startups<>Investors. I don’t think you actually need scripting. 
Did you try out basic automations?

Feel free to take a look at this post on the matchmaking setup.

Feel free to schedule a call using this link and I’d be happy to help you out!

Mike, Consultant @ Automatic Nation


@Mike_AutomaticN approach looks really good, without any need for scripting. 

If you still want to go through the scripting route, here’s how you should approach:

First, you make a simple map of the fields you care about and give each one a weight. For example, you might decide that bedrooms are worth 2 points, city is worth 1 point, and so on for price, state, or any other criteria you choose.

When you run the matching, you start each score at zero. Then for each field in your map, you check the value in the Has record and the value in the Needs record. If both are non empty and they match exactly, you add that field’s weight to the score. If either value is missing or they don’t match, you simply move on without changing the score. Over all the fields you get a total that reflects how well the two records line up.

Taha, Airtable Advisor


Hm, this really depends on how you want the output to look I reckon.  If you’re okay with a new table where each record represents a single Has <> Needs link, then you could technically achieve this with an automation and a large number of lookup and formula fields for comparisons

And I’ve set it up here for you to check out.  The idea is that whenever a new ‘Request’ comes in, it’ll trigger an automation that’ll take all the records in Properties, and create one record each in the ‘Properties <> Requests’ table with a Repeating Group action.  If you have >1000 actionable properties you’ll need to add in a small scripting step, and if you have >8000 properties then this solution doesn’t work though as repeating groups have a 8k limit

 

There’s an argument to be made that using a script is easier to maintain and less clunky, which I kind sort of see, but for me maintaining the script was a lot more confusing in the long term than having a ton of fields like this heh


Reply