Welcome to the community, @Praveen_Jain! :grinning_face_with_big_eyes: Would you mind sharing the script that you’re using? It’s tough to know what’s happening without seeing the script details. When sharing the script, please format the code using the preformatted text option in the comment editor toolbar (the button looks like this: </>
)
Welcome to the community, @Praveen_Jain! :grinning_face_with_big_eyes: Would you mind sharing the script that you’re using? It’s tough to know what’s happening without seeing the script details. When sharing the script, please format the code using the preformatted text option in the comment editor toolbar (the button looks like this: </>
)
Thanks Justin for replying
Below is the code. I hope I have use the correct preformat for code.
let mainTable = base.getTable("Txn");
let mainTableRecords = await mainTable.selectRecordsAsync({fields:["MapIdentifier"]});
let lookupTable = base.getTable("Typ_Act_Map");
let lookupRangeRecords = await lookupTable.selectRecordsAsync({fields:["MapID","AccountsID"]});
for (let record of mainTableRecords.records) {
let lookupValue = record.getCellValue("MapIdentifier");
for(let rangeRecord of lookupRangeRecords.records) {
if (rangeRecord.getCellValue("MapID") === lookupValue) {
let linkID = rangeRecord.id;
mainTable.updateRecordAsync(record, {
"SuggestedID_Lkp_Ref": [{id: linkID}]
});
}
}
}
Welcome to the Airtable community!
You are running into a rate limit. You are only allowed to submit up to 15 requests per second.
For now, the easiest fix is to put the await
keyword in front of this line that submits the update request. This is also why you are not seeing the error—the script ends before it gets the error.
Eventually you will want to learn how to submit your requests in batches of 50. A bit later you may also want to learn how to build an index so you do not need the nested loops. Both of those techniques will make the script faster, which is important if you ever get a pro account and want to run the script as an automation.
Welcome to the Airtable community!
You are running into a rate limit. You are only allowed to submit up to 15 requests per second.
For now, the easiest fix is to put the await
keyword in front of this line that submits the update request. This is also why you are not seeing the error—the script ends before it gets the error.
Eventually you will want to learn how to submit your requests in batches of 50. A bit later you may also want to learn how to build an index so you do not need the nested loops. Both of those techniques will make the script faster, which is important if you ever get a pro account and want to run the script as an automation.
Thank you so much. await keyword helps and I am able to get the desired results for all the records now.
I am new to scripting and still learning
Will learn how to build and index