About Coalesce field

ducdat2406
Tera Contributor

I have 3 fields in field map : userid, employeeid and off-board date
userid and employeeid are coalesce
How can i use status_message = 'user id and employee id are empty' in case both fields are empty
Thanks for answering

2 REPLIES 2

Amit Gujarathi
Giga Sage
Giga Sage

HI @ducdat2406 ,
I trust you are doing great.
You can write Business Rule for the same.
Please find the code for the same.

(function executeRule(current, previous /*null when async*/) {

    // Check if both userid and employeeid are empty
    if (!current.userid && !current.employeeid) {
        current.status_message = 'user id and employee id are empty';
    }

    // Else, you can add additional logic here if needed

})(current, previous);

Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi



Actually your solution quite good, but i want to do it in transform script instead of business rule. Do you have any solutions else ?