Parse CSV attachment and insert data into staging table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2019 04:15 AM
Hello All,
I have a case where user uploads multiple .csv files into table and I need to parse the .csv files and add the data into staging table. After that transform map runs and adds data into actual table.
Can someone let me know how can I parse the csv content and create records in staging table using script. I cannot using import set and data source as user does not upload the file into data source. The file is uploaded as attachment.
Any help is appreciated!
Thanks,
Nancy
- Labels:
-
Multiple Versions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2019 10:26 PM
Hey,
The no. of files to be attached would be dynamic. Also there can be multiple records in which multiple files are attached. So I cannot have already created data sources for each.
Is it possible to have a single data source? I can attach the csv file to the data source from the script and then do the importing and transforming procedure.
Or can I create data sources on the fly as required and delete them after the importing is done. It does not seem a feasible solution but can it be considered?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2019 09:20 AM
Hi Nancy,
I believe you can create data source on fly; but in that case you would require at least 1 data source so that it can be used to create the dummy data source and you can proceed further.
But I think this approach would be somewhat tedious and lengthy
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader