Apr 16, 2021 08:18 AM
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 :slightly_smiling_face:
Apr 16, 2021 10:31 AM
The absolute easiest way to do it would be replacing:
await input.buttonsAsync('Proceed?', ['Yes', 'No'])
with
true
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.
Apr 17, 2021 02:33 AM
@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 :slightly_smiling_face:
Apr 17, 2021 09:53 AM
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:
output.text(...)
or output.markdown(...)
let settings = input.config(...)
tolet 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")
}