Import .dat file into SN
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2016 10:14 AM
SN supported data formats for import are csv, excel and xml. However, I have a use case where I have to import data from .dat files with specific delimiters (obtained from an external system) into SN. Has anyone come across such a use case before? If so, please let me know what your approach was.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-22-2016 08:24 AM
Prit,
This is a fixed length file with no delimiters. So while renaming the file from .dat to .csv gets it to the point that it will be recognizable to ServiceNow, it does not get you to the point of loading the data properly. Can you supply a sample with at least three example records?
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-22-2016 08:36 AM
Sure Dan, thanks for the correction. I'll upload the sample file with example records.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-22-2016 08:44 AM
Hi Chuck,
There's a small correction in the comment I made about the source file format. It is a fixed length file with no delimiters. Could you please check the comment made by Dan and look at the sample file I've attached and share with me your thoughts on this!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-22-2016 02:17 PM
One idea that may be worth trying is to import it as a single line record. Create a transform map with no field mapping and then use the transform script to parse each source line in to various components using Regex/split then save it to the target fields.
http://wiki.servicenow.com/?title=Transform_Map_Scripts
Regex help in episodes 31 and 32 here: TechNow Episode List
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-22-2016 02:53 PM
Thank you Chuck,
But could you help me understand 'importing it as a single line record'! Does it still involve renaming the .dat file to .csv? Because, the basic idea here is to preserve the formatting of source data which has commas (,) and a .csv would not preserve the commas any more.
I understood the transform script part, but if you could help me understand the single line record part, I guess that'll do the trick.
Prit