Update Records with external API data with a validation step

Hi there, I work for a prison education nonprofit that works with people facing federal crimes. We want to be able to send legal updates and resources to graduates of our classes, and use Airtable to track those graduates. We want to keep our records updated as to when graduates of our classes are transferred to a new federal prison, had their release date changed, or been released.

Anyone incarcerated in federal prison is given a register number. You can use that number to get release date and location data from this API. We’ve been using a combination of Python scripts to do this but it’s been clunky and buggy because I’m not that great at Python (frankly I’m not that great at coding, period, but I’m learning). I think we can do this more efficiently with a script in Airtable.

Here’s the one catch: every once in a while, someone puts in the wrong register number for our graduates. Is there a way to show values returned from an API side by side with the current values in the Airtable record and prompt the user to confirm that they want the script to overwrite the current Airtable value with the ones it pulled from the API? That way if there’s a typo in the register number, we’ll see it because it’s someone else’s name in the API data.


Hello @The_Focus_Forward_Pr,

I don’t fully know how you enter the register number but if you are trying to do it through a script here’s a skeleton of how you can do it:

let nameFromRecord = 'John Doe';//read name from table
let nameFromApi = 'Jane Doe';//read name from api

output.text(`Name in Airtable: ${nameFromRecord}`);
output.text(`Name from API: ${nameFromApi}`);

let updateRecord = await input.buttonsAsync('Update Record?', ['Yes', 'No']);

if (updateRecord === 'Yes') {
    //update the record here
    output.text('Updated Successfully');
} else {
    output.text('Did not update the record');