I need to concatenate the multiple fields in one variable ,I have a Name variable in the catalog ite

Archana23
Tera Contributor

I need to concatenate the multiple fields in one variable ,I have a Name variable in the catalog item and referring to one of the table, For eg If I select  AAAK , then in the below Address variable It should auto populate with concatenation of country, state, city, street, Zip code.  Please suggest.

If it can be done by a script, please help me in scripting.

 

Thanks in advance.

 

Archana23_0-1726679117252.png

 

1 ACCEPTED SOLUTION

Brad Bowman
Kilo Patron
Kilo Patron

If you are on the Utah or later release you can do this without a server script using the Variable Auto Populate feature.  To concatenate, you would create string variables for country, state, city, street, and zip.  You can hide these variables on the forms.  In each variable you would specify the Name variable in the Dependent question on the Variable auto populate tab, then dot-walk to the desired field.  Then in an onChange or whatever Catalog Client Script you would just have one line

g_form.setValue('address_var_name', g_form.getValue('country_var') + g_form.getValue('state_var')...

View solution in original post

2 REPLIES 2

Brad Bowman
Kilo Patron
Kilo Patron

If you are on the Utah or later release you can do this without a server script using the Variable Auto Populate feature.  To concatenate, you would create string variables for country, state, city, street, and zip.  You can hide these variables on the forms.  In each variable you would specify the Name variable in the Dependent question on the Variable auto populate tab, then dot-walk to the desired field.  Then in an onChange or whatever Catalog Client Script you would just have one line

g_form.setValue('address_var_name', g_form.getValue('country_var') + g_form.getValue('state_var')...

Is it possible without creating fields and hiding them.