Submitting/Updating an catalog item request using transform map ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2019 10:40 AM
Hi All,
We are submitting multiple requests at one time using the data source. So for creation of Request, Requested item, we have used transform script and there is no field we have added in the transform mapping as all are variables, in our data source, because of which once the transform is run, we are not able to know that how many records got inserted or how many got updated. It is showing all rows with the Ignored status, but in actual it is updating some and inserting some rows all via the "onBefore" transform script.
Is there any better way to handle this, if someone had faced this kind of challenge, could you please share your thoughts.
TIA.
- Labels:
-
Field Service Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2019 10:55 AM
Call me I will explain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2019 03:52 AM
Hi,
You can use "Import Set API" ( https://docs.servicenow.com/bundle/geneva-servicenow-platform/page/integrate/inbound_rest/reference/... ) to implement it.
- Create a table that extends Import Set Row
- Create Transform Map [Create a temp (u_reques_data) table set as target table]
- Writ Transform Script (onAfter and onBefore) as per requirement
- in onBefore write some script to Submitting/Updating an catalog item request.
- You neet to user (Service catalog script API) in your Transform script. ( @ https://docs.servicenow.com/bundle/newyork-application-development/page/script/server-scripting/refe... )

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2019 08:23 AM
HI,
We have to use Cart functionality to create REQ and RITM.
var cart = new Cart(); var item = cart.addItem('e2132865c0a8016500108d9cee411699'); // Item ID
cart.setVariable(item,'os','Linux Red Hat');//Used to set variables.
var rc = cart.placeOrder(); gs.addInfoMessage(rc.number);
Make sure you write this script in Onbefore script or script on transform maps.
Thanks,
Ashutosh Munot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2020 02:08 PM
Hi Ashutosh,
I used same above on before transform script and my transform map is on request table. But it is creating an additional request with no ritm as well.
My excel document which I loaded contains just one catalog item sys id.
Two requests are getting creating one with ritm (sysid of the cat item) and another without ritm just request record. Can you please help me to fix the issue.
Tried using On after as well instead of on before in transform script but no luck , it's causing the same issue in my personal dev as well.