Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

how create space between opened by variable and Business account variable in the attached image

srinu8
Tera Contributor

how create space between opened by variable and Business account variable in the attached image 

4 REPLIES 4

CaiqueS
Tera Contributor

Hi @srinu8,

 

The image is not attached in your post. Could you share it again?

 

Thanks

srinu8
Tera Contributor
 

Naveen20
ServiceNow Employee

Please attach image

Naveen20
ServiceNow Employee

 There are a few ways to add spacing between the "Opened By" and "Business Account" variables:

Option 1: Use a Label variable as a spacer

Go to the catalog item's variables and create a new variable with type Label. Set the order so it falls between "Opened By" and "Business Account." Leave the question text empty (or add a single  ). This effectively inserts a blank row as a spacer.

Option 2: Use a Container layout with split rows

Place "Opened By" and "Business Account" in separate Container Start/End variable blocks. Containers naturally add visual separation between groups of variables.

Option 3: CSS override in the portal theme or widget

Add custom CSS to your portal theme or via a CSS Include to target the specific variable:

/* Target the Business Account variable by its name attribute */
[variable-name="business_account"] {
    margin-top: 20px !important;
}

Or more broadly, if you know the variable's item_option_new sys_id:

#sp_formfield_YOUR_VARIABLE_SYS_ID {
    margin-top: 25px !important;
}

Option 4: Macro with HTML spacer

Create a UI Macro variable that contains just a <div> with a set height, and insert it between the two variables in the ordering:

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core">
    <div style="height: 20px;"></div>
</j:jelly>

The Label variable approach is the quickest and doesn't require any code. The Container approach is the cleanest from a maintainability standpoint if you're already grouping variables logically.