Help

How to update a table from a js object?

363 0
cancel
Showing results for 
Search instead for 
Did you mean: 
psg30delhi
4 - Data Explorer
4 - Data Explorer
const common_js_object = {COMMON_OPTIONAL: 'Optional',
COMMON_NA: 'N/A',
COMMON_AND: 'and',
COMMON_TERMS: 'Terms of Use',
COMMON_PRIVACY: 'Privacy Policy',
COMMON_OR: 'OR',
}
}));

console.log(newRecords);

const batchSize = 50;
const numRecords = newRecords.length;

for (let i = 0; i < numRecords; i += batchSize) {
const batchRecords = newRecords.slice(i, i + batchSize);
await table.createRecordsAsync(batchRecords);
console.log(`Created ${batchRecords.length} records`);
}

I written this script to create a new record inside a table from a javascript object. But I want to be able to update the entire table from this object instead of creating new records. 

I am not sure how to use the updateRecordAsync method. I am new to coding. I tried different approaches but showhow they all gave error could anyone help me. 
0 Replies 0