need help with scripting

cj10121
Tera Contributor

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?

10 REPLIES 10

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! */


Brad Bowman
Kilo Patron
Kilo Patron

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);

 

Here are the tables. The appt. table is an ext. of the task table. Not all of the fields are utilized/ Client FN and MN, and LN are there

also this is the record producer that it is auto populating into

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?