Airtable script to fill in missing data
This example shows you how to add a scheduled automation that fills in missing data using aito.ai predictions.
Last updated
This example shows you how to add a scheduled automation that fills in missing data using aito.ai predictions.
Last updated
aito.ai extension for Airtable is in review, and hopefully live soon. Check back please.
In this example we create an automation that fills in the best product category for the new products in your inventory, based on their brand, name and description.
Here's how our starting point looks like, the last four products don't have the category defined. Also we assume that you already have the data uploaded to aito.ai.
Kick off by choosing the automations tab from the right pane, unless you already have that open, and click "Create a custom automation".
There might be several ways to trigger your automation, but in this example we use "When record matches conditions", and set the rules according to the following picture.
Another typical way is to create a timed event, that triggers e.g. every 15 minutes.
For the action, choose "Run script". This will open a full screen editor to write your script in to.
As a first step, add the input variable that the trigger gives to the automation script. This is done on the left side of the editor, and below is an example that gets you going.
Next, let's get scripting! This broken to chewable chunks.
First block gets the chosen record (id) in to a variable, and then gets the matching record from the table.
Then let's get aito.ai ready for use. First, configure your instance url, as well as give the read-only API key (you'll find these from the Console).
Second, we construct a query that will go to aito.ai. Find more examples about queries here, but simply define the table where the training data is, define fields in where
-block for inputs and then the prediction target.
With this, we are ready to send the query to Aaito.aiito for predictions. Here's how it happens. We naturally recommend catching errors better than here in the simplified examples.
One step left! Based on the results from aito.ai, we then update the original record's category, as well as data to "confidence" field, so that it is easier to track the accuracy of predictions later on.
Coding done, all is in place! You can test your script with the Test-button in the top right corner, and if all is great, close the full screen editor with "Finish editing". After closing, remember to click "Done" on the script block to finish the entire process.
\