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?

14 REPLIES 14

Akki1
Tera Contributor

@Saurav11 yes even i am surprised but  this is only occuring if it is in second row and 1st row got ignored due to invalid sys_id i had made choice action as ignore

Yeah if the sys_id does not match it will get ignore which is correct.

 

Can you try with 6 or 7 record and try it have the empty one at 3rd row and 5th row and see how it works

Akki1
Tera Contributor

@Saurav11 

Thanks

I have one scenario could you help with this?

I want to create these records here and import xml to other instance so suppose if the table2_sys_id is not present here then as condition mentioned it will not create but anything possible to hold that sys_id and in the other instance this sys_id is present so if it can hold then while importing xml to other instance it can map?Anything possible

hello,

 

No in m2m you will not be able to add a new field plus as you are using xml to import it will not map even if you able to hold it somewhere.

 

Please mark my answer as correct based on Impact.

 

 

Akki1
Tera Contributor

No, I don't want to create new field. If I use that and allow it to hold ?

or if I allow it to create record will then work then? but I think that  will become display value and sys_id of the created record will differ I guess right?