Catalog Item - same variable in two different orders?

Elizabeth26
Tera Contributor

I have a catalog item and I have 1 variable that I'd like to use in 2 different orders (areas) on the catalog item.

Is this possible?

I tried using a UI policy but that did not work.

1 ACCEPTED SOLUTION

Hi Elizabeth,

Sounds like you are right, you'll probably have to create a new variable and add support for that variable into your scripts.

The issue is once the item is submitted, what is the real value for a variable that has 2 values on the form? This would cause issues with your scripts/workflows/BR/Client scripts/etc.

Example, if you have "Name" field in two places

You enter a value for both, John, Tom

A script runs and there is a condition if(name == 'John').. but name was overwritten to be 'Tom' and now the script doesn't function correctly.

 

View solution in original post

4 REPLIES 4

Musab Rasheed
Tera Sage
Tera Sage

Elaborate your requirement, if you want to use same variable in two different places in item then it's not possible, one possible approach is to create two variables of same name and place at different places using 'Order' field.

Please hit like and mark my response as correct if that helps
Regards,
Musab

Jorn van Beek
Tera Guru

if you want to use the same variable over different items you should use a variable set.

if you want to use the same variable multiple times on the same item, then closest you get is to use a multi row variable set.

Elizabeth26
Tera Contributor

The problem is the variable I want to use is in a quite a few scripts. 

To make things easier I'd like to use it twice in the same form but it's needed in 2 different areas.

I think I will just have to create a new variable and add it to the scripts but was trying to avoid that if possible.

Hi Elizabeth,

Sounds like you are right, you'll probably have to create a new variable and add support for that variable into your scripts.

The issue is once the item is submitted, what is the real value for a variable that has 2 values on the form? This would cause issues with your scripts/workflows/BR/Client scripts/etc.

Example, if you have "Name" field in two places

You enter a value for both, John, Tom

A script runs and there is a condition if(name == 'John').. but name was overwritten to be 'Tom' and now the script doesn't function correctly.