Expand my Community achievements bar.

SOLVED

Update flag based on conditions from data loaded from file

Avatar

Level 1

I am loading data for email addresses from a file and updating its data in EmailAddress Schema which has a link refering to recipient schema, there is a flag primary_email which i have to update based on below conditions and also need to update email data in recipient schema 
• If one customer has multiple email addresses, consider the email_verify_status = Yes as primary
email address.
• If there are more than one verified email addresses for a single customer any one email address can
be chosen as primary email address.
• If there is only one email address for the customer, then assign that as the primary email address
irrespective of the email_verify_status flag value
how can this be achieved ?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @akarshan-dehal ,

You can achieve the use case by below Workflow logic

Workflow.PNG

As per your condition, I had created a sample CSV in which Person_1 has 2 records, and in which Test1@gmail.com to be updated as Primary email (because the flag is yes), and for Person_2 there are multiple records, and in which any email is fine to be updated (as he have many Yes in flag) and for person_3 and person_4 they have only one email, so it needs to get updated.

Data.PNG

Data Loading activity:

Go to Click here to change the file format > Double click email_verify_status > in Remapping, do the configuration as below,

DataLoading.PNG

 

Deduplication Activity:

Select temporary schema > Unique Identifier to Identify duplicate > Select 'Using an expression' and in expression select ' email_verify_status' and Keep the records with Largest value.

Dedup.png

After this you will be getting the expected output as you mentioned in Question. Followed by you can use update data activity to update the email in respective schema.

Result.PNG

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @akarshan-dehal ,

You can achieve the use case by below Workflow logic

Workflow.PNG

As per your condition, I had created a sample CSV in which Person_1 has 2 records, and in which Test1@gmail.com to be updated as Primary email (because the flag is yes), and for Person_2 there are multiple records, and in which any email is fine to be updated (as he have many Yes in flag) and for person_3 and person_4 they have only one email, so it needs to get updated.

Data.PNG

Data Loading activity:

Go to Click here to change the file format > Double click email_verify_status > in Remapping, do the configuration as below,

DataLoading.PNG

 

Deduplication Activity:

Select temporary schema > Unique Identifier to Identify duplicate > Select 'Using an expression' and in expression select ' email_verify_status' and Keep the records with Largest value.

Dedup.png

After this you will be getting the expected output as you mentioned in Question. Followed by you can use update data activity to update the email in respective schema.

Result.PNG