Feb 01, 2023 07:22 PM - edited Feb 01, 2023 07:24 PM
hey! trying to get this script to run, and I cannot seem get it right. Any help would be appreciated!
Scenario: I'm trying to update a list of Records as a step in an automation. I have my automation to receive both the row for which the values will be inherited from, and the list of records in which to deposit the values.
I've modified what seems to be a popular script, below:
Script
let config = input.config();
let StackerEmail = config.StackerEmail
let ALink = config.ALink
let records = config.RowIDs
let table = base.getTable("Projects");
for (let record of records) {
await table.updateRecordAsync(record, {
"[For Stacker] A Email": [{StackerEmail}],
"A Link": [{ALink}],
})
}
The error I receive:
ERROR
Error: Field "fldLpHsJuxicnS2eZ" cannot accept the provided value.
at main on line 8
input (With examples & field types)
RowIDs | rec7eF4Q0oCnT3Yfi, rec9rkbTs8QjYvC5Y, recC3F48nlqUuu5KL, ect. (Type: List of 'Airtable record ID')
StackerEmail | test@test.com (type: Email)
ALink | Max Eval 2 (Type: Linked Record Name)
Columns being edited (Will receive the values):
"[For Stacker] A Email"
"A Link"
As a note, both the input, and the desired output rows are within the same table.
Thank You!
Feb 01, 2023 09:00 PM
First, could you update the "ALink" input config to be the linked record ID instead of name?
Then, try modifying this bit:
"[For Stacker] A Email": [{StackerEmail}],
"A Link": [{ALink}],
To:
"[For Stacker] A Email": StackerEmail,
"A Link": ALink,
If this doesn't work, if you could provide a link to an example base with the script set up I could help you take a look at it
Feb 01, 2023 09:54 PM
are both of the column types you're trying to updated, links to multiple records?
if so, the object to update it with should be an array of ids, for ex:
await table.updateRecordAsync(record, {
"[For Stacker] A Email": [{id: StackerEmail}],
"A Link": [{id: ALink}],
})
https://airtable.com/developers/scripting/api/cell_values#multiple-record-links
hope that helps!
Feb 02, 2023 07:17 PM
Thanks for this! Unfortunately, this did not help for me... For more clarity - I have these configured so that plain text input will kick off another automation to make these work.. essentially, what I really just need is to input the plan text values of StackerEmail & Alink.
for more context, I realized I can give more insight into the debugger:
Feb 02, 2023 07:19 PM
So all of the columns to be updated are their own standalone records. I have other automations that are adding a reference ID to another column, and that's how I am identifying the columns themselves in prior steps.
Essentially, I just need the string values into these fields. Even if I cannot get a field into ALink -- the Stacker email field is most crucial, and still it will not go.
Feb 02, 2023 07:36 PM
FYI: I believe I found a solution. essentially I abandoned using the alink field, and I abandoned the {[]} on the second part
"[For Stacker] A Email": StackerEmail,
Thank you for the help!!
Feb 02, 2023 07:37 PM
FYI: I believe I found a solution. essentially I abandoned using the alink field, and I abandoned the {[]} on the second part
"[For Stacker] A Email": StackerEmail,
Thank you for the help!!