Help

Seeking Assistance with Referral Code Duplicates in Airtable

422 0
cancel
Showing results for 
Search instead for 
Did you mean: 
michelyoussef
4 - Data Explorer
4 - Data Explorer

Hello Airtable Community,

I hope this message finds you well. I'm currently working on a project where I've implemented a referral code system in Airtable, and I could use some guidance on handling potential duplicates.

Here's a brief overview of the situation: I generate referral codes in the format "Four letters of firstname, -D, and last 2 digits of the phone number." For instance, if I have a user named Johnathan with the phone number ending in 19, the referral code would be JOHN-D19. If i have another user named John with the phone number ending in 19, the referral code would also be JOHN-D19. 

Now, the challenge I'm facing is that I want to avoid assigning the same referral code to different individuals. To achieve this, I'm looking for a solution to identify and handle duplicates. Here's the logic I'm aiming for:

  1. Identify Duplicate Referral Codes:

    • If the referral code is duplicated, proceed to the next step.
  2. Check for Same Person:

    • Compare the email and phone number associated with the duplicated referral codes.
    • If both the email and phone number match, it means it's the same person, and the referral code remains unchanged.
  3. Handle Different Phone Numbers:

    • If only the last 2 digits of the phone number are the same, increment the last 2 digits of the referral code by 1.

I'm struggling with implementing this logic in Airtable, and I would greatly appreciate any insights, tips, or examples that could help me achieve this goal. Your expertise and support mean a lot to me.

Thank you in advance for your assistance!

Michel Youssef

0 Replies 0