List collector value is not showing in the Request Summary

Samiksha2
Mega Sage

Hi,

 

I have a script include in which we are returning the value and by the client script we set the value in the list collector.

But the problem is that value is not visible in the request summary although it is populating in the form. I checked all the UI policies client script written on that variable.

Please help in this,

 

Thank you!

1 ACCEPTED SOLUTION

Hi @Samiksha2 ,

 

The issue that I see is in your script include. You should be returning the list of sys_id back to your client script as list collector expects sys_id and not the name of the record(s).

 

Just for fun, before making any change, could you please test your onchange client script from backend and not portal. I am sure your field will not autopopulate.

 

I would suggets make change as shown below and I believe it should work:

 

getRoleFam: function() {
var dri = [];
var p_dri = this.getParameter('sysparm_callerSysID');
var roleName = this.getParameter('sysparm_role_name');
if (roleName == 'Product Family Manager') {
roleName = 'taxonomy_node_owner';
}
var recDri = new GlideRecord('spm_taxonomy_node');
recDri.addQuery(roleName, p_dri);
recDri.query();
while (recDri.next()) {
dri.push(recDri.getUniqueValue());
}
return JSON.stringify(dri);
},

 

 

Pleae let me know if this do not works.

 

 

I Hope this helps.

 

Please mark this helpful if this helps and Accept the solution if this solves your issue.

 

Regards,

Kamlesh

View solution in original post

21 REPLIES 21

Logan Poynter
Mega Sage
Mega Sage

Hello,

Is the field empty on the request summary, or is it not present? If the list collector is populated on the form, then it shouldn't be a permission issue. Are you able to provide screenshots so we can have a better understanding of what's going on?


Please mark my answer as correct/helpful if it has helped you.

Thanks,
Logan
--
LinkedIn 

Hi @Logan Poynter,

 

Yes Empty Value is coming. 

Hi @Samiksha2 ,

 

Could you please provide the screenshot of your issue, which field you are fetching and where populating,

Also please provide the script that you are using. It will helps us better to understand your issue

 

Regards,

Kamlesh

Hi @kamlesh kjmar ,

Client script on OnChange

function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {

return;
}

var selected_role = g_form.getValue('u_pt_select_remove_people_role');

var ajax1 = new GlideAjax('getDivRole');
ajax1.addParam('sysparm_name', 'getRoleFam');
ajax1.addParam('sysparm_role_name', selected_role);
ajax1.addParam('sysparm_callerSysID', g_form.getValue('u_pt_select_the_user'));
ajax1.getXML(populateValuess);


function populateValuess(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
var ans = JSON.parse(answer);
g_form.setValue('u_pt_people_product_family', ans);

}

}

 

Script Include:

getRoleFam: function() {
var dri = [];
var p_dri = this.getParameter('sysparm_callerSysID');
var roleName = this.getParameter('sysparm_role_name');
if (roleName == 'Product Family Manager') {
roleName = 'taxonomy_node_owner';
}
var recDri = new GlideRecord('spm_taxonomy_node');
recDri.addQuery(roleName, p_dri);
recDri.query();
while (recDri.next()) {
dri.push(recDri.name.toString());
}
return JSON.stringify(dri);
},

 

In the form on change of Remove Product Family is coming. But when i am submitting it.

Samiksha2_0-1666862563540.png

In the Request Summary page nothing is coming.

In the RITM value is not coming . Flow is stuck because of this.

 

Samiksha2_1-1666862719904.png