Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Need to Display Email ID Next to Name in List Collector (Watch Parties) for record producer variable

akhilaprasa
Mega Contributor

 

Hi Team,

I am facing an issue with a Record producer variable configuration and need your guidance.

Scenario:
We have a variable called Watch Parties in a the item. It is a List Collector mapped to the Watch list field and uses the sys_user table. When searching for users in this field, only the Name is displayed.

This creates confusion because we have multiple users with the same name (e.g., Santhosh Kumar). For fields like Requestor and Affected User, the system shows the email ID next to the name, which helps identify the correct person. We need the same behavior for Watch Parties.

Current Configuration:

  • Variable Type: List Collector
  • List Table: sys_user
  • Reference Qualifier: javascript:active=true^sourceLIKExOU=Users^ORsourceLIKExOU=Contractors^ORsourceLIKExOU=Partners^ORsourceLIKExOU=External^nameISNOTEMPTY^EQ
     
  • Variable Attributes Tried : ref_ac_display_value=true,ref_ac_columns=email,user_name

Methods I Tried:

  1. Added ref_ac_columns=email,user_name in Variable Attributes → No effect.
  2. Tried ref_ac_display_value=true → No change.
  3. Checked for Display Templates → Not available in my instance.

Expected Outcome:

When searching in the Watch Parties List Collector, I want to see: Name | Email | 

similar to Requestor and Affected User fields.

But its not working, Any help or best practice would be appreciated!
Thanks in advance.

1 ACCEPTED SOLUTION

@Akhila P 

it should work for reference and list collector type variable

what's your variable type? share screenshots

did you give complete variable attributes like this?

you need not give name field in ref_ac_columns

ref_auto_completer=AJAXTableCompleter,ref_ac_columns=email,ref_ac_columns_search=true,ref_ac_order_by=name

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

View solution in original post

7 REPLIES 7

Hello @Ankur Bawiskar ,

 

I used the following in the variable’s attribute field:

ref_auto_completer=AJAXTableCompleter,ref_ac_columns=email,ref_ac_columns_search=true,ref_ac_order_by=name

It’s working as expected now. Thank you so much for your help!

@akhilaprasa 

Glad to help. yes all to be added.

Please mark my above response as correct and close the thread.

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

Renat Akhmedov
Kilo Sage

Hi @akhilaprasa,

The behavior you’re seeing is expected. List Collector variables do not support ref_ac_columns or ref_ac_display_value, even though those attributes work for regular reference fields such as "Requestor" or "Affected User".


Instead, create a "Display" Business Rule on the "sys_user" (table: "sys_user", when: display):

 

(function executeRule(current, g_scratchpad) {
    current.setDisplayValue(current.name + ' | ' + current.email);
})(current, g_scratchpad);


OR 

use the variable attribute: 

ref_auto_completer=AJAXTableCompleter,ref_ac_columns=email,ref_ac_columns_search=true,ref_ac_order_by=name



I hope it helps, and if my answer was helpful, please don’t hesitate to give it a thumbs-up - it only takes a second, but it means a lot to me. Thank you!

Best regards,
Renat Akhmedov