Hi,
I am using a webhook triggered script to copy incoming data into 2 tables. None of the updated columns are links.
let uwTable = base.getTable("ATDS data");
let crTable = base.getTable("Combined repository 2")
let inputData = input.config()
console.log(inputData)
let validateRecord = async (newApplicationNumber) => {
if(!newApplicationNumber || newApplicationNumber === "") {
return true
} else {
let exisitingCases = await uwTable.selectRecordsAsync({fields:["Application No."]});
let existingApplicationNumbers = exisitingCases.records.map(r => r.getCellValueAsString("Application No."));
console.log(exisitingCases.records.map(r => r.getCellValueAsString("Application No.")));
console.log(newApplicationNumber)
return existingApplicationNumbers.includes(newApplicationNumber) ? false : true;
}
}
let isValid = await validateRecord(inputData.application_number);
//adding case to Combined repository 2 w/o validation
await crTable.createRecordAsync({
"Repository Record ID": inputData.repository_record_id,
"Hub": {name: inputData.hub},
"City": {name: inputData.city},
"APPLICATION NUMBER":inputData.application_number,
"Phone": inputData.phone,
"Merchant Name": inputData.merchant_name,
"Father name": inputData.father_name,
"Documents link": inputData.documents_link,
"Loan Amount": inputData.loan_amount,
"Tenure": inputData.tenure,
"Finbox Status": inputData.finbox_status,
"Is Valid": isValid ? {name: "Yes"} : {name: "No"}
});
//adding case to ATDS cases with validation
if(isValid) {
await uwTable.createRecordAsync({
"Repository Record ID": inputData.repository_record_id,
"Hub": {name: inputData.hub},
"City": inputData.city,
"Application No.":inputData.application_number,
"Phone no.": inputData.phone,
"Drive Link": inputData.documents_link,
})
}
I arbitrarily (only for a few cases) get the below error:
Error: Field "fldOx0V2uAPlLp6LQ" cannot accept the provided value.
at main on line 22
Sharing the input data:
I have gone through other threads with a similar issue, but wasn’t able to find a fix. Any help would be appreciated