Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to show message in portal banner

chaitanya34
Tera Contributor

Hi Team,

 

How to show message in top of service portal, please find below image I created custom widget, but that meesage is showing in top of search bar, I need message in top of portal or after image

chaitanya34_0-1720161433688.png

Widget code :

<div ng-if="isVisible" class="alert alert-info">
<button type="button" class="close" ng-click="dismiss()">
<span>&times;</span>
</button>
<p>Welcome, your company is: {{::company}}</p>
</div>

 

Server side : 

 

(function() {
    data.userCompany = '';
    data.isCompanyActive = false;
    var userSysId = gs.getUserID();
    var userGR = new GlideRecord('sys_user');
    if (userGR.get(userSysId) && userGR.company) {
        var companyGR = new GlideRecord('core_company');
        if (companyGR.get(userGR.company) && companyGR.vendor == true) {
            data.userCompany = companyGR.name.toString();
            data.isCompanyActive = true;
        }
    }
})();
 
Client controller :
 
function($scope) {
    $scope.company = $scope.data.userCompany;
    $scope.isVisible = $scope.data.isCompanyActive;

    $scope.dismiss = function() {
        $scope.isVisible = false;
    };
}
5 REPLIES 5

Yashsvi
Kilo Sage

Hi @chaitanya34,

please check below link:

https://www.servicenow.com/community/developer-forum/how-to-new-message-in-servicenow-portal-banner/....

Thank you, please make helpful if you accept the solution. 

No Announcements are not accepting my customer, need customizations

Trupti94
Kilo Sage
Kilo Sage

Hi @chaitanya34 ,

 

do you want clickable link for this message? or it is just header?

chaitanya34
Tera Contributor

Not link when user open ServicePortal I need message should display on top banner