cloudops
Tera Expert

To add multiple attachment buttons to a portal for a catalog item in ServiceNow, you can follow these steps:

1. Navigate to the Service Portal Configuration page.
2. Click on the Designer.
3. Select the page where you want to add the multiple attachment button.
4. Drag and drop the "Multiple File Upload" widget to the desired location on the page.
5. Save the changes.

Please note that the "Multiple File Upload" widget allows users to upload multiple files at once. If you want to add multiple buttons for different purposes, you may need to create custom widgets or modify the existing one.

Here is a sample code for a custom widget:

javascript
// Client Script
function($scope, $http) {
$scope.files = [];
$scope.upload = function() {
var fd = new FormData();
angular.forEach($scope.files, function(file) {
fd.append('file', file);
});
$http.post('/api/now/attachment/file', fd, {
transformRequest: angular.identity,
headers: {'Content-Type': undefined}
})
.success(function(){
// success code
})
.error(function(){
// error code
});
};
}