How to set same target fields with 2 different target table in field map

Gautam Raj
Tera Contributor

I get the below error while trying to set same target field (Virtual) in 2 different target tables under the same transform map.

GautamRaj_0-1740999268012.png

Error - "An existing map to this target field already exist"

 

My requirement is to set the target field "Is Virtual(virtual)" for 2 target tables in the same map. Below are the 2 target tables am trying to map the field to

cmdb_ci_lb

cmdb_ci_netgear

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Gautam Raj 

you have only 1 transform map and you want to set 2 target fields with same source value?

If yes then system is blocking you?

If yes then why not use onBefore transform script for the 2nd field like this

target.fieldName = source.u_is_virtual;

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

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

View solution in original post

8 REPLIES 8

Hi Ankur,

Yes i have only 1 transform map and i want to set 2 target fields with same source value.

GautamRaj_1-1741003808814.png

So in this case my onBefore transform script should be like below ? correct me if am wrong

target.Virtual = source.u_is_virtual;

@Gautam Raj 

correct, ensure source field name and target field name are correct.

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

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

@Gautam Raj 

how the target table is different if only 1 transform map is there?

1 transform map will have 1 target table and all field maps under it should be for the same target table as that of the table defined in transform map

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

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

Ankur Bawiskar
Tera Patron
Tera Patron

@Gautam Raj 

I believe you have 2 transform maps and each transform map is having same source field but different target field on those 2 separate tables?

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

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