Service portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā12-04-2023 05:20 PM
I need to create a custom widget for importing the bulk data into service portal , as I am new to service portal let me know how to solve this
Thanks
Lakshmi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā12-04-2023 06:16 PM
What type of data you want to import? And what is the Target table? Who will upload the data (role or user who can upload the data)? Whether they upload any file like Excel?
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā12-04-2023 06:30 PM
Excel file data want to be upload
Any tagret table
User want to be upload
Only Excel file need to be import
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā12-05-2023 12:49 AM
@srilakshmikanth It would be little complex to build this from scratch. You can refer the following article for quick start.
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā12-04-2023 06:26 PM
HI @srilakshmikanth ,
I trust you are doing great.
1. Understand the Requirements
- Data Format: Determine the format of the data to be imported (e.g., CSV, Excel).
- Data Destination: Identify the ServiceNow table where the data will be imported.
2. Set Up the Service Portal Widget
- Create the Widget: In ServiceNow, navigate to Service Portal > Widgets and create a new widget.
- Widget Basics: Give your widget a name and a description that reflects its purpose.
3. Design the Widget's Front-End
- HTML Structure: Design the HTML to include a file upload input.
- Client Script: Use AngularJS for client-side scripting to handle the file upload event.
SAmple HTML code :
<div class="file-upload">
<input type="file" id="fileInput" ng-model="data.file" accept=".csv"/>
<button ng-click="c.upload()">Upload</button>
</div>
Sample Client Script
function($scope, spUtil) {
$scope.upload = function() {
var fileInput = document.getElementById('fileInput');
var file = fileInput.files[0];
// Further processing of file
};
}
Sample Server Script
api.controller = function() {
/* widget controller */
var c = this;
// Define the method to handle file processing
c.processFile = function(fileData) {
// Parse fileData and insert into a ServiceNow table
// Use GlideRecord for database operations
};
};
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi