The CreatorCon Call for Content is officially open! Get started here.

Transform Map script to create multiple system properties

Khalnayak
Kilo Sage

Hi All,

I am working on bulk importing 50 record producers into ServiceNow.

The only issue I have is the script. I need to add script for all record producers which I have.

The only thing that changes on the script for each Record Producer is the assignment group, as there will be specific group for each record producer.

I cannot use the sys id directly in the script and have to use gs.getproperty().

So I need help in creating a transform map script which looks at the group column in my sheet and for each record producer, it:

1. fetches the sys id of the group

2. Creates a system property with the group name and adds sys id to the value

3. Populates the script and adds the current.assignment_group = gs.getProperty(<sys id of property>);

Thanks.

1 ACCEPTED SOLUTION

Oh I didn't know that field existed, great find.

In that case, you can just push the group into that field, and use the following in the script:

current.setValue('assignment_group' , cat_item.group);

View solution in original post

6 REPLIES 6

Kieran Anson
Kilo Patron

Rather than creating a bunch of system properties, have you thought about using templates on the record producer? Does you column contain the group sys_id or name?

HI, we do not have an option for incidents under record producer, how do you create template for record producer?

yes have fulfillment group column with group names.

Also, I found a fulfillment group field within record producer form which is OOB.

Can I leverage that field and mention that in script? can you access the fields of the record producer? as doing producer.name only works for variables?

Oh I didn't know that field existed, great find.

In that case, you can just push the group into that field, and use the following in the script:

current.setValue('assignment_group' , cat_item.group);

Thank you! @Kieran Anson that worked great!.

I also did the same for mapping short desc and desc fields from record producer to inciden.

That worked but with description field, it is bringing over the html tags too. How can I remove these please?

find_real_file.png