Convert list variable values to string and be copied into a single line text variable

alberttagle
Tera Contributor

Hi,

I need help on how to create a catalog client script to convert a list variable containing values from a table to a string and will be used as part of a single line text variable.

 

Details:

I have a list variable calling from core_country.list which displays the values from 'name' column.

users could select multiple values.

 

The requirement is to copy the selected values (countries) to a single line text field, separated by commas.

 

1 ACCEPTED SOLUTION

Sujatha V M
Kilo Patron
Kilo Patron

@alberttagle  Please follow the below steps to populate the values to the string field. 

 

1. OnChange client script for list collector 

 

SujathaVM_0-1712335853433.png

 

2.  Create and call the script include in client script, 

 

SujathaVM_1-1712335909322.png

3.  Finally the result of cascading the values to string field.  

 

SujathaVM_2-1712335961597.png

 

Note: Kindly ignore the "Alerts" which I have used for testing it. 

 

Please mark this as helpful and accept it as a solution if this resolves your query.

Thanks,

Sujatha V.M.

 

Please mark this as helpful and accept it as a solution if this resolves your query.
Sujatha V.M.

View solution in original post

8 REPLIES 8

@alberttagle You have entered "GLideRecord" instead of "GlideRecord". 

 

SujathaVM_3-1712373993438.png

 

Script works fine and cascades other field values as well. 

 

Make sure you enter them properly and add logs and test it to know where it fails. 

 

For cascading other form variables, I have used a checkbox as an example below. 

 

SujathaVM_2-1712373935039.png

 

If the checkbox is "True", 

SujathaVM_5-1712374269792.png

If checkbox is "False",

SujathaVM_6-1712374286656.png

Please mark this as helpful and accept it as a solution if this resolves your query.

Thanks,

Sujatha V.M.

Please mark this as helpful and accept it as a solution if this resolves your query.
Sujatha V.M.

Thanks a lot! 🙂

Hi Dear,

I used same script as you mentioned above but it's not working for me, could you please validate and reply to me ASAP. Thanks.

1) Client script:

ANANTHULANAVEE_0-1723801296269.png

2) Script include:

ANANTHULANAVEE_1-1723801333897.png

 

3) Output:

ANANTHULANAVEE_2-1723801356256.png

 

 

 

 

 

 

 

 

IbrahimK4837164
Tera Contributor

Use a catalog client script to monitor field state changes and show or hide a message based on it. You will need to use JavaScript functions to access the field element and control its display on the page. Check the field ID when unlocking and hiding to correctly handle changes to its state.