How to import data from CSV file source to create a catalog item?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2017 11:35 PM
Hi,
I want to import bulk data from CSV file source to create a new catalog items and want to have the attributes in my file to be the variables of the catalog item.
For this, I have created an import set and have also created a source table from which data will transform into my target table.I have also created a transform map.I want to add variable,category and catalog in the catalog item.And I also want to add the deafult values in the variables.As for each catalog items the variables will be same but their default values will be different.
So I want to run a script in the transform map.How can I do that with a script so that a new catalog item will get generate and variable set,categories will get provided to it.
How can this be done with the help of the script.How can I bulk import data to create new catalog items?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-30-2017 04:32 AM
Hi Ishaan,
If you want to do this way, then you have to proceed this way:
- Create a data source with attachment type and attach the CSV
- Create an import set table for pulling all the columns in CSV to staging table attributes.
- Create transform map for mapping all the attributes in the catalog item table (sc_cat_item)
- Create a OnAfter transform script something like this to create variables from the columns in your CSV.
var gr = new GlideRecord('question');
gr.initialize();
gr.question_text= source.varibale1text;
gr.name= source.variable1name;
gr.type='7'; // say for check box
gr.insert();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2019 07:52 AM
Hi Ishaan,
I'm having same requirement. Did you achieved it? If yes, Can you give the guidance.
Regards,
Suresh Loganathan.
Suresh.