need help with scripting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I am trying to auto-populate names in my service catalog record producer. Pulling from the client table to the appt table that I created. I am not using the sn appt table. I have created a catalog UI policy when a change occurs, and Script include for the client calling and a Script for the catalog and created a new ACL. I am not the best at the scripting and leaned on SN chat gpt but it is not populating. Can someone help. Have I made this too restrictive?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hi @cj10121,
I'm lost from many screenshots without any context. Auto-populating what exactly?
Please try to explain your issue in an easy way, you have add multiple replies each one with different screenshots and I don't see the point.
Explain what's the issue, what it does and what you want to do
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
You should add some gs.info lines to the Script Include and alert(client.first_name) to the Client Script to see how far it is getting. If these logs include values used in the script you'll see where it is going wrong. Your screen shots don't show the actual field names on either table so confirm those are all exactly what is used in each script (case and space sensitive). Try using GlideRecord in place of GlideRecordSecure, and in place of your return use:
return JSON.stringify(response);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
The three added screenshots still don't show the actual field and variable names. Add the Column name field to the table list layout, and Name to the Variable related list layout. These are the values that must match what you are using in the scripts. Did you try with the return syntax I suggested?