- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2023 04:00 AM
Hi all!
I try to auto populate catalog item variables (in portal) with an excel import. The reason is that I end up with almost 50 variables in the catalog item. To simplify things, I created an item with 3 variables in my PDI. I am trying to add an 'import from excel' button in the portal to load all the variables for the catalog item from the excel. As an example, I have chosen the following variables: Name (Reference), Group (Select Box) and Additional Information (Multi Line Text).
Excel:
Does anyone have an idea/approach for implementing my example?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2023 06:16 AM
Hi @Marcel Hartmann ,
Hope you are doing great.
if you want to update the excel files received in email as attachement with catalog item variable , You can achieve this with inbound email action using email parser API.
Create a catalog item in ServiceNow that includes the desired variable fields to capture the information from the Excel file.
Ensure that the catalog item has the 'Import via Excel' button enabled, allowing for Excel file import.
Configure the Email Inbound Action:
- Set up an email inbound action to process incoming emails with Excel file attachments.
- Configure the email inbound action to create a request for the desired catalog item when an email with an Excel attachment is received.
- Extract the necessary information from the Excel file to populate the variable fields of the catalog item.
Extract Data from Excel File:
- Utilize ServiceNow's Excel Parser API or similar libraries to extract data from the Excel file in the email attachment.
- Parse the Excel file and retrieve the required information from the appropriate columns and rows.
- Map the extracted data to the corresponding variable fields of the catalog item.
Create Request and Populate Variables.
// Parse the Excel file and extract data
var excelData = ExcelParser.parseExcel(fileAttachment);
var columnAData = excelData.getColumn('A');
var columnBData = excelData.getColumn('B');
// Create a request for the catalog item
var request = new GlideRecord('sc_request');
request.initialize();
request.cat_item = 'YOUR_CATALOG_ITEM_ID';
request.insert();
// Populate the variable fields with extracted data
request.variables.variable1 = columnAData[0];
request.variables.variable2 = columnBData[0];
// Set values for additional variable fields as needed
request.update();
Regards,
Riya Verma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2025 09:01 PM
Hello Marcel,
I have a similar requirement. Do you have any solution for this excel import?
Please share some insights from your analysis.
Thanks,
Sowmiya M