- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2023 04:54 AM
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!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2023 09:12 AM
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();
Bharath Chintala
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2023 04:59 AM
@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.
Bharath Chintala
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2023 05:04 AM
@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
Thank you for your help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2023 05:13 AM - edited 02-10-2023 05:14 AM
@Patrick Slatter Remove .getDisplayValue() while setting that field as it is list collector system understands sysid only not name
Bharath Chintala
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2023 05:29 AM - edited 02-10-2023 05:31 AM
Same result with teh display value removed
//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";