So I have this scenario where before creating a new domain based email ID for new employees, the snap after generating the email ID has to check against the existing email IDs in Google directory and create the email ID if it is not a duplicate else add auto-incremented number to the email ID.
For example, let's consider I have created a new user with "
test.user@abc.com.au". Now when another user comes in with the same first name "test" and last name "user", it should lookup in the existing data if there is any under the same name, if so append auto-incremented numbers. In this case, "
test.user1@abc.com.au" should be inserted. Let's consider two records of the same name that come in during the same run. In that scenario, as a record with the name itself and suffixed with "1" (2 records) exists, it should insert one of the incoming records as "
test.user2@abc.com.au" and the other as "
test.user3@abc.com.au".
I am kinda stuck as to what snap or logic to use when it comes to the lookup section as the newly created email ID has to be checked against every record's email ID field to find if it already exists.