Variable re-order in different sections/containers

VullankiL
Tera Contributor

Hi All,

I have one record producer, in which there is one variable "Please select the lines of business" (List Collector).

I want to use the same variable in different section/containers.
In some sections, the variable should be displayed in middle of set of other variables. In one section it should be displayed in the top of all questions. 
So, I need to change order through script according to that. How to achieve this.

Please help me with this..

Thank you

2 ACCEPTED SOLUTIONS

M Iftikhar
Mega Sage

@VullankiL ,

You can only use a variable once in a record producer, so you won’t be able to script reordering of the same variable across different sections.
If you need the same “Please select the lines of business” field in multiple places, the usual approach is to create multiple copies of that variable (with different internal names/IDs) and position them where required.

If you want to keep things reusable and consistent, you can also put the variable inside a variable set, which can be reused across different catalog items/record producers.

 

Thanks & Regards,
Muhammad Iftikhar

If this helped, please mark it as the accepted solution so others can benefit too.

View solution in original post

Ankur Bawiskar
Tera Patron
Tera Patron

@VullankiL 

1 variable can be shown only once on catalog form.

If you require list collector in other section, create separate variable and add it there.

Not possible to script and change the order.

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

4 REPLIES 4

M Iftikhar
Mega Sage

@VullankiL ,

You can only use a variable once in a record producer, so you won’t be able to script reordering of the same variable across different sections.
If you need the same “Please select the lines of business” field in multiple places, the usual approach is to create multiple copies of that variable (with different internal names/IDs) and position them where required.

If you want to keep things reusable and consistent, you can also put the variable inside a variable set, which can be reused across different catalog items/record producers.

 

Thanks & Regards,
Muhammad Iftikhar

If this helped, please mark it as the accepted solution so others can benefit too.

Hi @M Iftikhar ,
Thank you for the response.
I have a question like even if we use variable sets, if we cannot change the order of the variable.. then also we cannot re-order them in different containers for middle/top/bottom right?

@VullankiL ,

That’s correct, even with variable sets you can’t re-order the same variable differently across sections/containers. A record producer treats each variable as a separate entity, and each variable has one value that applies to the entire form. If you need it in different positions, you’d still need to create separate copies of the variable and place them accordingly.

 

Thanks & Regards,
Muhammad Iftikhar

If this helped, please mark it as the accepted solution so others can benefit too.

Ankur Bawiskar
Tera Patron
Tera Patron

@VullankiL 

1 variable can be shown only once on catalog form.

If you require list collector in other section, create separate variable and add it there.

Not possible to script and change the order.

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