The CreatorCon Call for Content is officially open! Get started here.

Get All variable values onChange to a widget

ServiceNow Tech
Tera Contributor

I have a catalog item with 1 custom variable(Service portal widget mapped) and 5 normal variables like single line text.

In the custom variable, I want to show all the remaining filled variable values and whenever any variable value changes, it should auto update in that widget.

For example: My single line text variables hold 'Abc', 'def', 'ghi', 'jkl', 'mno' values in them then my widget should display

Abc, def, ghi, jkl, mno.

If I update ghi to xyz then immediately, widget should show Abc, def, xyz, jkl, mno.\

 

How can i do that?

8 REPLIES 8

@ServiceNow Tech 

then get all the variables for that catalog item and then add individual logic

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Ankur Bawiskar 

I tried that and didnt work that's why I posted here.

I have the variables list in an array. So I wrote an for loop to go through the array elements but that logic didnt work.

Please let me know if any suggestions.

@ServiceNow Tech 

what challenge are you facing in that script?

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi @Ankur Bawiskar 

please help me on below query:

To display values of Multi Line Text in Separate Lines  using client script in servicenow

 i want display  automatically user name and phone number and mail in multi line text field in separateline using setvalue() method, can you help me on this . for instance refer below screen shot:

anitha0887_0-1715274305560.png