- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2014 01:30 PM
Hello, I'm fairly new to Service Now and I have not had any formal training as of yet. I am focusing on major clean up efforts I have run into problems trying to update configuration items in the system using the load data/import function. First off, can existing CI's data be manipulated or updated using load data/import sets? If yes then how can we perform the updates without creating new CI's? For example, I want to just update the location field from abc to xyc along with the status an assigned user = 3 attributes within the existing CI table. Please help - manually updating is not fun. We have not turn on AM as of yet as this is another project that is not yet slated to be scoped.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2014 03:50 PM
Hi Eri,
Yes, you can use import sets to overwrite data in existing CI's by marking one of the field map entries as the coalesce field: Using the Coalesce Field - ServiceNow Wiki. If your import data source has a field that uniquely identifies the CI, simply mark it as the coalesce and ServiceNow will ensure matching CI's are updated instead of inserted.
Here are a couple wiki articles that may help:
Creating New Transform Maps - ServiceNow Wiki
Transform Map Scripts - ServiceNow Wiki
Kind regards,
Travis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2014 07:49 AM
Thanks so much!
In UCMDB, I updated the following on the pushToServiceNow.py:
## Are Service Now Web Service Import Sets in use?
importSetUse = 1
if importSetsInUse and importSetsInUse.lower().strip() in ['yes', 'y', '1', 'true']:
importSetUse = 1
Then I created the Web Service import records in ServiceNow for a handful of tables. I then created the jar files for the new web service tables, create test CIs in UCMDB and ran the integration. It created them and the relationships as expected. I then tested a scenario where I updated an attribute in the map but it failed on the first table it hits.
Do you know if there are additional scripting changes in the .py script or on the ServiceNow side to allow update?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2014 09:11 AM
Hi Andrew,
Honestly, I am not sure. I personally have no experience with UCMDB or its ServiceNow integration and the latest documentation I could find (2012) said it did not support Import Sets at that time.
From the looks of things, it seems as though when it uses direct web services, UCMDB stores the ServiceNow sys_id in the probe so that it can perform SOAP Updates. I am wondering if the Import Set method attempts to do a similar SOAP Update on the Import Set table. This would not work, import set web services should always be insert.
But without seeing the Python/Jython its hard to say. Are you able to share the script? Another option, is you could turn on SOAP logging in ServiceNow, try an insert, try an update and then share the log results of the SOAP envelope. This may give us an indication. SOAP Web Service - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2014 06:33 AM
Great call on the SOAP debugging. I am actually embarrassed I forgot about it.
I believe the issue is that the external id captured but the UCMDB probe is the sys_id of the target record. Based on other articles I have read, when a web service tries to update, it does not look at the target record but the import set record because that is the table being referenced. One suggestion I found was that the only action that should be called is Insert. So I am combing through the python script trying to comment out the update lines to see if that will work. If you know another way to have an update action that will not look at the import set table, I would be very interested in hearing it.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2014 06:45 AM
Hi Andrew,
You are exactly right. When using import sets, you can only insert. The import set transform map determines whether to insert or update an existing record. So when using import sets with a transform map, the process is:
1. Web Service Inserts into Import Set Table
2. Import Set Transform Map is used to Insert or Update Target Record
So whenever you want to Update, you should actually Insert with a field in the Transform Map marked as the Coalesce (make sure its a unique field). So don't just comment out the update in the python, force the update to use the insert process instead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2014 10:12 AM
Thanks so much. I have this working finally and it is way better than the out of the box.
