Help

Merge duplicates records and delete last one

215 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Mr_Anderson
4 - Data Explorer
4 - Data Explorer

I'm working on an automation that is triggered when a record is created.

Here's how it works:
I have a Fillout academy registration form with the action create a record on Airtable in the Sourcing table;
When the user submits the form, a record is created in the Sourcing table and triggers the automation to perform the following actions:
- Retrieve and check if the selected course exists;
- Check whether a learner or candidate already exists, using the email address as the unique field in the Learner table;
- If the candidate exists, we check if he/she has an existing sourcing, taking the existing candidate and the training course as parameters;
- If the sourcing doesn't exist, I proceed with the relationship between the existing candidate and the course (thus updating the newly created sourcing by attaching the existing candidate);
- If the candidate does not exist, I create the candidate in the Learner table and link it to the sourcing created in the Sourcing table;
- If the candidate exists and the sourcing also exists, I update the old sourcing by changing its status to "Duplicate".

But here's the problem: if a user submits the form with the same training several times, I end up with several sourcings created for the same candidate.

I'd like to do this, find a way to detect if the candidate already contains two sourcings, the third should merge with the most recent and delete it right after.

How can I do this in the same automation?

Thanks

1 Reply 1
TheTimeSavingCo
18 - Pluto
18 - Pluto

Hmm, would it work if you had a Find Record action that looked for sourcings linked to the candidate that's submitting the form and had a conditional check on the number of records found by that action?  Sorry, not sure I fully understand your problem and setup!