Edit a script "delete duplicate"

Hey everybody !

I am using the this “delete duplicate” script Apps - Airtable Marketplace and i would like to edit it. Because the script need a user answer to carry out the action (yes or no) when he find a duplicate into the conditions. And I would like the script carry out “yes” by himslef at each time. Are someone able to edit the script for me? Or explain to me how can I do?

Thanks you so much :slight_smile:

The absolute easiest way to do it would be replacing:

await input.buttonsAsync('Proceed?', ['Yes', 'No'])



or if you want to do it the right way, you’d delete:

let decision = await input.buttonsAsync('Proceed?', ['Yes', 'No']);

and also delete:

if (decision === 'No') {
    output.text('Operation cancelled.');
} else {

and then delete the very last line, which is just a } by itself.

1 Like

@Kamille_Parks thanks for your help! So i deleted the part “awai…” and replaced by true, it is working fine. A just need something more, is it possible to keep the script always working by itself ? Like I don’t need to Run ? Thanks :slight_smile:

You could set up an Automation to run when records are added/updated, or regularly like once per day. You would need to convert the script to one compatible with an Automation “Run script” action. That requires more edits to be made:

  • Delete every line that begins with output.text(...) or output.markdown(...)
  • Change let settings = input.config(...) to
let getTable = await base.getTable("Enter the name of your table here")
let settings = {
   table: getTable,
   firstIdField: getTable.getField("Enter the name of the field"), 
   secondIdField: getTable.getField("Enter the name of the field"), 
   comparisonField:  getTable.getField("Enter the name of the field")