Transform script is not working as expected

AshwiniR
Tera Contributor

Hi team,

 

    We are making account state = Inactive and Active = False for the below mentioned External id(Target) values which is mapped with u_customer_account(Source) records using transform script.

CAN003206

AN_CUST2889

AN_CUST2794

 

Using the below transform script

 

if (source.u_customer_account_no == 'CAN003206' || source.u_customer_account_no == 'AN_CUST2794' || source.u_customer_account_no =='AN_CUST2889') {
    target.u_account_state = 1;  // Assigning 1 to u_account_state
    target.u_active = false;     // Assigning false to u_active
} else {
    target.u_account_state = 0;  // Assigning 0 to u_account_state
    target.u_active = true;      // Assigning true to u_active
}

 

In the image you can see all the records are showing same value.

AshwiniR_0-1720529885374.png

 

 

Kindly Assist on this.

2 REPLIES 2

Dnyaneshwaree
Mega Sage

Hello @AshwiniR ,

1. Ensure that the source field u_customer_account_no and target fields u_account_state and u_active are correctly mapped in your transform map.
2. Verify that the field types are correct (e.g., u_account_state should be an integer and u_active should be a boolean).
3. Add logging to your script to see what values are being processed.

 

 

Please accept my solution if it works for you and thumps up to mark it as helpful.
Thank you!!

Dnyaneshwaree Satpute
Tera Guru

Harish Bainsla
Tera Sage
Tera Sage

 

Hi @AshwiniR  

Check Field Names: Ensure the field names (u_customer_account_no, u_account_state, and u_active) are correct and match the names in your source and target tables.