How to remove spacing between variables on a Record producer?

sree31
Tera Contributor

I have created 52 variables on a Record Producer and 30 UI policies using UI policy script. I wanted to reduce spacing between two variables. I tried using setvisible() and setdisplay() in the UI policy script but its not working. Please find the below attached Image. I want to reduce space between the rich text label variable and a multiline text. There are many variables in between those with multiple UI policy conditions.

 

Thanks & Regards

Sree

1 ACCEPTED SOLUTION

-O-
Kilo Patron
Kilo Patron

Are you sure the Rich Text does not have extra new lines in its content?

View solution in original post

4 REPLIES 4

SatyakiBose
Mega Sage

Hello @sree31 

I validated this on my Utah PDI.

The spacing is uniform when you use a client script, UI policy script, or UI policy actions to hide a field.

So the steps that I tried are:

  1. Created 5 Single Line Text field. (screenshot 1)
     satyakibose_0-1676277720551.png

     

  2. used setdisplay in the client script to hide field 2
  3. used setdisplay in ui policy script or UI policy action to hide field 4
  4. When vieweing the catalog spacing is uniform.

Which version of the platform are you running

Shaikh Mzhar
Tera Guru

Hi @sree31 

 

To reduce the spacing between two variables on a ServiceNow Record Producer, you can use CSS styles to adjust the margin or padding of the elements that contain the variables.

Here's an example of how you can use CSS styles to reduce the spacing between a rich text label variable and a multiline text variable:

  1. Open the record producer that contains the two variables that you want to adjust the spacing for.

  2. Click on the "Variables" related list to see a list of all the variables on the record producer.

  3. Locate the variable that you want to reduce the spacing after (in this case, the rich text label variable).

  4. Click on the variable's name to open the variable form.

  5. In the "Attributes" section, add a new attribute called "Container CSS Style" with a value of "margin-bottom: 0;". This will remove the default bottom margin of the container element that holds the rich text label variable.

  6. Click "Update" to save the changes to the variable.

  7. Repeat steps 3-6 for the variable that you want to reduce the spacing before (in this case, the multiline text variable), but use "margin-top: 0;" instead of "margin-bottom: 0;" to remove the top margin of its container element.

If it helps please click Accept as Solution/hit the Thumb Icon

-O-
Kilo Patron
Kilo Patron

Are you sure the Rich Text does not have extra new lines in its content?

sree31
Tera Contributor

Hi, 

 

I just reduced the spacing in the Rich text. It worked on the Record Producer.