Reordering of Variable Sets

surbhibarnw
Tera Contributor

Hi everyone, 

I have a requirement where two variable sets: "Shipping Information" and "Billing Information" are there. I need to show "Shipping Information" first if a user checks the checkbox "Ship to a different address" variable. And if "Ship to a different address" is unchecked then "Billing information" would be showing first.

 

 

1 ACCEPTED SOLUTION

YaswanthKurre
Giga Guru

Hi @surbhibarnw ,

 

To dynamically reorder variable sets like "Shipping Information" and "Billing Information" based on a checkbox ( "Ship to a different address"), this is only possible via DOM manipulation using a Catalog Client Script.

 

ServiceNow does not natively support reordering variable sets at runtime, but you can achieve the desired behavior with DOM manipulation, which is not a best practice and not recommended by ServiceNow.

 

Please mark this as helpful and correct if this answers your question.

 

 

Thanks,

Yaswanth.

View solution in original post

5 REPLIES 5

Hi,

It is not possible to dynamically order the variable. You can try this option which will give user a feel of re ordering.

Duplicate "Shipping Information" variable set. Keep all the question (Display value) same but suffix the name field with _different_address (or any meaning full suffix for your enviroment) so that all the names are unique and you will not see any error.

Now Keep the Original Shipping Information as first order and then Billing Information second order, newly created Shipping Information as third one.

Create a UI Poilcy to hide the first Shipping Information variables and show the second Shipping Information variables if "Ship to a different address" is checked. Users will have a feeling that order changed. You can also copy the values from one variable to other or vice versa based on the check box selection If these variable are used in any flow or script for any processing.

Thank you,
Palani