how to check condition in Transform map script

Akki1
Tera Contributor

Hi,

I have excel file which contains two column sys_id1 & sys_id2

Now I am importing records in u_m2m_table where i have two fields field1 and field2. These two fields are references to table 1 and table 2 respectively. Now while importing records in  u_m2m_table I want to check if sys_id1 and sys_id2 are valid and then insert else ignore.

Also I want to insert only if sys_id1 & sys_id2 these both fields are not empty.

I know to use onBefore scripts. But how can it be done? What to write the content?can anyone help with this?