- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2022 11:27 AM
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!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 06:27 AM - edited 10-27-2022 06:31 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 04:42 AM
Try adding toString to your answer - I had a similar issue with populating a multiline text variable without it: g_form.setValue('u_pt_people_product_family', ans.toString());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 04:48 AM
Thanks for the reply @Logan Poynter
I tried to add toString() but same issue. Value is not coming.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 05:17 AM
Got it, then I would create an onsubmit script to log the value and make sure it's populated with what is expected. Have you tried that yet?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 05:27 AM
Hi @Logan Poynter ,
I didnt try with OnSubmit client script. Shall I create OnSubmit with the same code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 05:31 AM
No, just make a new onsubmit client script to get the field value and log it. My thought is its not storing the value expected so it's not presented on the portal.
Also, when viewing portal have you checked browser console for any errors that may be logged? Likely something helpful there.