Populating Variables on RITM using Transform Map

Swati Mishra
Tera Contributor

I have a requirement to create Requested Items using data in Excel. This file will also contain the variables that are required to create the RITM if created using service catalog. But here the data will be fetched using an excel file. So I want to know how can I achieve populating the Request variables using transform map. I am able to populate the fields placed directly on the Requested Item form, but having an issue populating the Request variables.

1 ACCEPTED SOLUTION

@Swati Mishra 

since you have excel file you will have to parse it and get the variable value and use Cart API

Regards
Ankur

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

View solution in original post

7 REPLIES 7

Sebastian R_
Kilo Sage

Instead of using a transform map to import data directly into sc_req_item you should use the Cart-API to create requested items.

https://docs.servicenow.com/bundle/orlando-application-development/page/script/server-scripting/reference/r_ServiceCatalogScriptAPI.html

Ankur Bawiskar
Tera Patron
Tera Patron

@Swati Mishra 

you will have to use Cart API for this

Also you need ExcelParser script to parse the excel row by row and create RITM with all the variable info

https://developer.servicenow.com/app.do#!/api_doc?v=newyork&id=GEPS-GlideExcelParser

these links will help you as well

Reading Attachment Contents || Copying attachment || Attachment Properties

Loading data from an email attachment

Script to create RITM with variable info

How to submit a catalog item from script?

Create requests from excel import

Regards
Ankur

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

Hi Ankur,

I referred to this article to create RITM

Creating a Service Request: Using Service Catalog Script API with Inbound Emails and Attachment. 

RITM gets created successfully with the desired catalog item. But I am unable to populate catalog variables using data of columns in my excel attachment. Which part of this code do I have to work upon to solve this issue?

 

@Swati Mishra 

since you have excel file you will have to parse it and get the variable value and use Cart API

Regards
Ankur

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