How to resize variable editor in requested item form

Aayushi tandon
Tera Contributor

Hi Everyone, I need to reduce the size of this grey box, this is variable section of the requested item table. is it possible to achieve these?

 

image (1).png

 

2 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron
Tera Patron

@Aayushi tandon 

you can try to use DOM manipulation in onLoad client script on RITM table.

Note: DOM is not recommended practice, please inform your customer

This script worked for me in case you wish to use, I adjusted the width to 500px, you can adjust as per your need

Ensure "Isolate Script" field is False for your client script to allow DOM

If this field is not on form then make it false from list view

function onLoad() {
    //Type appropriate comment here, and begin script below
    var element = document.getElementsByClassName('veditor_body');
    element[0].style.width = '500px';
}

AnkurBawiskar_1-1747062032849.png

 

Output:

AnkurBawiskar_3-1747062067232.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

@Aayushi tandon 

Add this in 3rd line of your UI macro

<style>
.veditor_body {
    width: 50% !important;
}
</style>

 

Accept the solution and mark as helpful if it does, to benefit future readers.
Regards,
Sumanth

View solution in original post

10 REPLIES 10

SumanthDosapati
Mega Sage
Mega Sage

@Aayushi tandon 

Variable editor is a Formatter and unfortunately you cannot resize it OOB.

 

Accept the solution and mark as helpful if it does, to benefit future readers.
Regards,
Sumanth

@Aayushi tandon 

Only way you might even think of is either try customizing the jelly in UI macro named "com_glideapp_servicecatalog_veditor" 

Or create a new UI macro as per your requirement and tag that with the UI Formatter.

 

Accept the solution and mark as helpful if it does, to benefit future readers.
Regards,
Sumanth

where i can modify in UI macro to adjust the width of variable section?

@Aayushi tandon 

Add this in 3rd line of your UI macro

<style>
.veditor_body {
    width: 50% !important;
}
</style>

 

Accept the solution and mark as helpful if it does, to benefit future readers.
Regards,
Sumanth