Help

Re: Airtable Automation- Update Record

Solved
Jump to Solution
1361 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Patrick_Baker
6 - Interface Innovator
6 - Interface Innovator

I am trying to use the new Airtable Automation to update record. I have a form that captures updated information whil I am auditing a computer. This information is stored in a table called Encryption Audits. I want to use airtable’s built in automation to update a separate table with any information that has changed. Encryption Log is the name of this table. When I try and set it up to update, I get “received invalid input.” I am attemptimg to take the fields from the encryption audit table and update my encryption log table with this information. Even tried just having it update the record with text I typed in manually. All attempts end with invalid input. Any help would be much appreciated.

1 Solution

Accepted Solutions
Kamille_Parks
16 - Uranus
16 - Uranus

Your step failed because your test passed “G5ZJCP2” as the value for the Record ID. That is not a Record ID.

You need a “Run a script” action step before your “Update record” step to filter your Encryption Log records to {Serial # or Service Tag #} = "G5ZJCP2"

For the script to work you’ll need a script input variable, set it up like so:
“Input variable name”: tag => “Input variable value”: Record (Step 1: Trigger) ... {Serial # or Service Tag #}

Then edit the script to be something like this:

const tag = input.config().tag
const logTable = base.getTable("Encryption Log")
const logQuery = await logTable.selectRecorsAsync()
const logRecords = logQuery.records

const matchesFound = logRecords.filter(x => {
    return x.getCellValue("Serial # or Service Tag #") == tag
})

output.set('logID', matchesFound[0].id)

Then use the output from the script (logID) as the Record ID for your “Update record” step.

This is all assuming your Audit Records aren’t linked to your Log records (even though they probably should be). If your records are being linked together when someone fills out the form, you can solve this with a simple Formula Field/Lookup Field setup and avoid writing a script altogether.

See Solution in Thread

3 Replies 3

Where are you getting “invalid input”? Assuming your Encryption Audits table and Encryption Log table contain fields of the same types, you should be able to transfer data easily.

Are you trying to use the Record ID pulled from your trigger record (a record in your Encryption Audits table) for the Record ID in the Update step? If so, you can’t do that because based on your own summary, the Update step is controlling another table; that Record ID does not exist in your Encryption Log.

I have a field named Serial Number that I want to use in to look up the record in Encryption Log. Field is same type field as in Encryption Audit table, and is named the same.I chose to update a field named validated by, which is just a short text field. It sees the information for that field when I select it, but I get step failed, received invalid inputs every time.

logsnip

Kamille_Parks
16 - Uranus
16 - Uranus

Your step failed because your test passed “G5ZJCP2” as the value for the Record ID. That is not a Record ID.

You need a “Run a script” action step before your “Update record” step to filter your Encryption Log records to {Serial # or Service Tag #} = "G5ZJCP2"

For the script to work you’ll need a script input variable, set it up like so:
“Input variable name”: tag => “Input variable value”: Record (Step 1: Trigger) ... {Serial # or Service Tag #}

Then edit the script to be something like this:

const tag = input.config().tag
const logTable = base.getTable("Encryption Log")
const logQuery = await logTable.selectRecorsAsync()
const logRecords = logQuery.records

const matchesFound = logRecords.filter(x => {
    return x.getCellValue("Serial # or Service Tag #") == tag
})

output.set('logID', matchesFound[0].id)

Then use the output from the script (logID) as the Record ID for your “Update record” step.

This is all assuming your Audit Records aren’t linked to your Log records (even though they probably should be). If your records are being linked together when someone fills out the form, you can solve this with a simple Formula Field/Lookup Field setup and avoid writing a script altogether.