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 change add alert notification background color as white in UI builder ServiceNow.

upendar5
Tera Contributor

I want to change alert message background color as white in UI builder.
I used below script can you please help me with this:


            items: [{

                id: "alert1",

                status: "positive",

                icon: "circle-check-fill",

                content: {

                    type: "html",

                    value: "<b>" + "Your request has been submitted." + "<b>"

                },

                action: {

                    type: "dismiss"

                },

            }]
 
Thanks Upendar.
2 REPLIES 2

Tushar
Kilo Sage
Kilo Sage

Hi there,

 

  1. I think you can update the UI Builder configuration file: <servicenow_install_dir>/etc/uibuilder/configuration.json.

  2. Open the configuration file and add the CSS code inside the "css" property:

 

{
  "items": [{
    "id": "alert1",
    "status": "positive",
    "icon": "circle-check-fill",
    "content": {
      "type": "html",
      "value": "<b>" + "Your request has been submitted." + "<b>"
    },
    "action": {
      "type": "dismiss"
    }
  }],
  "css": {
    "alert-container": {
      "background-color": "white"
    }
  }
}

 

 

Save the configuration file.

 

Restart the UI builder - servicenow-uibuilder restart

 


Mark as correct and helpful if it solved your query.

Regards,
Tushar

show me the screenshot image