Record Producer Values in Service Portal Ticket Fields Widget

Nia McCash
Mega Sage
Mega Sage

On my personal dev instance, I noticed that the Ticket Fields widget shows "variables" for an Incident that was created via the Password Reset record producer.

sp_getVariablesArray.jpg

Can someone advise on where this data is stored (ie. where is the relationship/link between the incident and the record producer stored) or how this is achieved?  

I was able to trace it to this line of code in the widget's Server Script data.variables = $sp.getVariablesArray(); but was unable to find documentation on https://developer.servicenow.com/app.do#!/api_doc?v=istanbul&id=c_GlideSPScriptableScopedAPI for the getVariablesArray() function.

1 ACCEPTED SOLUTION

Hello,



You could check 'question_answer' table


View solution in original post

12 REPLIES 12

Ryan,



I ended up doing this to get them to show up for me.   It isn't the cleanest but it solved my issue.



https://community.servicenow.com/message/1109621?et=watches.email.thread#1109621


Hi Ryan,
two points to check if  don't see some variable fields in "Options" area of your widget, on  'id=ticket' page.

1- Search in 'question_answer' table, if you could find records for "Table sys ID=sys_id of your ticket",    because data.variables = $sp.getVariablesArray(); from "Ticket Fields" widget look in this table.

2- if so , when you click on name of a variable in "Question" column to see options,
in "Availability" Tab does the checkbox "Visible on Summaries" is checked ?

in Kingston version, "Ticket Fields" widget filter has changed and use this checkbox value :

...  <div class="m-b break-word" ng-repeat="variable in data.variables | filter:{visible_summary:true}"> ...

ex : if you click on "Urgency" in Question column of question_answer table :
( you should arrive on item_option_new table)

find_real_file.png

NB :

- if you create an Incident from Backoffice, OOTB it doesnt  create records in 'question_answer' table
- if you use a record producer to create your ticket, then it should have save answers to your record producer's variables into this table.

Regards,
Denis.

 

 

bostonsnow
Kilo Guru

Denis - thanks for point #2 above, this helped me solve an issue I've been chasing for a while.

Does anybody happen to know if there is a way to control the order in which the variables are displayed in the Ticket Fields widget? We are on Madrid Patch 9b and the order of the variables displayed is completely random and changes on every ticket that is submitted. Very strange behavior that is unfortunately client facing and does not provide a very clean client experience. 

Thanks!

Mike