transform script target field

Praveen75
Tera Contributor

Hi, I have a scenario where if I get any value that doesn't exist in choice list (target table field is a choice list where label and field = ABC). The issue is how to set the target field value to the default value as 'ABC'. Please help me with this. Thanks.

If(source.u_company_name == 'ABC' || source.u_company_name == 'DEF'){

ignore =false;

} else {

target.u_company_name = 'ABC';  // not able to get this set

ignore =true;

}

1 ACCEPTED SOLUTION

Glad to know that my script worked.

Thank you for marking my response as helpful.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

11 REPLIES 11

Hi Ankur, able to get this set when I removed 'ignore=true' from else condition. Thank you.

Glad to know that my script worked.

Thank you for marking my response as helpful.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader