SYS ID displaying in list collector from record producer

Patrick Slatter
Tera Guru

Monring!

I am experiancing an issue with a list collector displaying the SYS ID instead of the display value. 

I have a list collector in a record producer that is using local choices (question_choice). This needs to log teh value and then map it into a list collector on the demand record that the record producer creates.

When this happens, it is placing the SYS ID into this field, instead of the display value. 

 

Any assistance would be greatly appriciated.

 

Thanks!

1 ACCEPTED SOLUTION

BharathChintala
Mega Sage

@Patrick Slatter 

use below code in record producer script

var sys = producer.u_impacted_other_cross_functional_teams;
var list =[];
var gr = new GlideRecord('question_choice');
gr.addQuery('sys_id', 'IN', sys);
gr.query();
while(gr.next()){
list.push(gr.value.toString());
}
current.u_impacted_other_cross_functional_teams=list.toString();

 

 

If my inputs have helped with your question, please mark my answer as accepted solution, and give a thumb up.
Bharath Chintala

View solution in original post

19 REPLIES 19

BharathChintala
Mega Sage

@Patrick Slatter  If you share script in record producer it will be easy to guide you.

 

but issue is that record selected is deleted or name also is sys_id.

If my inputs have helped with your question, please mark my answer as accepted solution, and give a thumb up.
Bharath Chintala

@BharathChintala I have tried this a few different ways but here is its current configuraiton.

Variable on record producer = 

Type= List collector

list table question_choice

REF QUAL = question=82bfb9db47a4a510578a8147536d4358

Var attributes = glide_list

 

Record producer script 

//passing value of custom fields to demand record
producer.u_period_start_date;
producer.u_project_request_type;
producer.u_project_category;
producer.u_function;
producer.u_subteam;
producer.u_impacted_other_cross_functional_teams;
producer.u_project_scope;
producer.u_project_owner;
producer.u_transformation_support_needed_alteryx_process_optimization_projects_only;
producer.u_metrics;
producer.u_estimated_hours_saved_annually_if_unknown_input_0;
producer.u_other_benefit_if_any_or_if_metrics_is_10above;
producer.u_cfo_org_okr;
producer.u_system_scope;
current.variable = producer.variable;
current.comments += comments;
current.u_impacted_other_cross_functional_teams = producer.u_impacted_other_cross_functional_teams.getDisplayValue();

 

gs.addInfoMessage(gs.getMessage('Demand {0} has been created.', ['<a href ="/dmn_demand.do?sys_id=' + current.sys_id + '&sysparm_view=ess&sysparm_view_forced=true">'+ current.number +'</a>']));
producer.redirect = "catalog_home.do?sysparm_view=catalog_default";

 

 

Field on demand form 

table = dmn_demand

name= u_impacted_other_cross_functional_teams

choices = 21 values defined 

PatrickSlatter_0-1676034245504.png

 

 

 

Thank you for your help!

@Patrick Slatter  Remove .getDisplayValue() while setting that field as it is list collector system understands sysid only not name

If my inputs have helped with your question, please mark my answer as accepted solution, and give a thumb up.
Bharath Chintala

Same result with teh display value removed 

PatrickSlatter_0-1676035709162.png

//passing value of custom fields to demand record
producer.u_period_start_date;
producer.u_project_request_type;
producer.u_project_category;
producer.u_function;
producer.u_subteam;
producer.u_impacted_other_cross_functional_teams;
producer.u_project_scope;
producer.u_project_owner;
producer.u_transformation_support_needed_alteryx_process_optimization_projects_only;
producer.u_metrics;
producer.u_estimated_hours_saved_annually_if_unknown_input_0;
producer.u_other_benefit_if_any_or_if_metrics_is_10above;
producer.u_cfo_org_okr;
producer.u_system_scope;
current.variable = producer.variable;
current.comments += comments;
current.u_impacted_other_cross_functional_teams = producer.u_impacted_other_cross_functional_teams;

 

gs.addInfoMessage(gs.getMessage('Demand {0} has been created.', ['<a href ="/dmn_demand.do?sys_id=' + current.sys_id + '&sysparm_view=ess&sysparm_view_forced=true">'+ current.number +'</a>']));
producer.redirect = "catalog_home.do?sysparm_view=catalog_default";