Help

Failed to construct the value for "Script input"

Topic Labels: Automations
2442 2
cancel
Showing results for 
Search instead for 
Did you mean: 
Theo_Michel
6 - Interface Innovator
6 - Interface Innovator

I have an automation that runs a script when records are created. The script has two input variables: the record ID of the created record, and an array of IDs taken from an array field in the created record.

When a record is created without an immediate value for the second input variable (the array) the script run fails with “Failed to construct the value for “Script input””.

I suspect this is happening because the script input generator is trying to do array.IDs and the array is null because the field is empty. But the correct behavior (IMO) would be to simple give my script a null value for that input variable, rather than filling my logs with failed script runs.

Anyone else seeing this? If so, how does one report bugs to the airtable team?

2 Replies 2
NHAD_Team
5 - Automation Enthusiast
5 - Automation Enthusiast

I’m afraid I can’t help but I’m having a similar issue. I have a created record triggering another record to be created in a different table, but it will only work if there is an attachment in one of the fields. If this is left empty I get ‘step failed’. Fingers crossed for a solution to this :crossed_fingers:t2:

Elizabeth_Slavi
5 - Automation Enthusiast
5 - Automation Enthusiast

I ran into the same issue. As a workaround, I retrieved the array of linked record IDs inside the script rather than using an input variable. More specifically, I followed these steps:

  1. Use base.getTable to get the table for the created record.
  2. Use table.selectRecordsAsync to get a recordQueryResult for all the records in that table.
  3. Use recordQueryResult.getRecord(recordId) to get the newly created record
  4. Use record.getCellValue to get the value from the linked record field

This certainly isn’t ideal, but it seems to work.