Select Variables Dropdown on Form

kurtbell1
Giga Expert

Does anyone have any idea how to get the "Select Variables" dropdown onto a form?   I see this in several places throughout the platform but have NO idea what this is and it is not obvious in Form Layout or Form Designer what it is.

Anyone ever integrated this into a custom form?

2018-01-09_16-20-33.jpg

1 ACCEPTED SOLUTION

If I am following what you want there is a "Field Name" type field that may do what you want.   Go to asmt_condition.list as an example and click new and then set the table to say Incident and then click the drop down for the user field.   You get something like this:


find_real_file.png


If this is what you want, then your User field will need to have a dependent table associated to it and the attributes of this to make it only allow user based fields is:


allow_references=true,reference_types=sys_user



Hint: I often go to the Dictionary table and look at field types and then look at the attributes of the fields to help.   This is where I found the above example.


View solution in original post

9 REPLIES 9

Michael Ritchie
ServiceNow Employee
ServiceNow Employee

Kurt, I am not sure I follow your question.   Your screenshot of the notification is confusing me.


Ahh - the image in the editor looks different from what posted.   I just adjusted, hopefully it makes more sense.


OK thanks.   Understand now.   The select variables is specifically for HTML fields and specifically for the "HTML Script" type fields.   What is the use case you are trying to use it for?   The expectation is its basically a script field underneath that gets evaluated to transpose the "variables" into actual values in the HTML.   If you use one you would need to eval the script to get the values in.



I see the HTML Script type field is restricted for use out of the box and you cannot selected it in normal ways.


We've got a custom table with a column that is a reference to sys_user.   What I'm hoping to do is on the form, allow the user to pick the reference they want in a fashion similar to what you see in my image. They may want to pick opened_for, opened_by, assigned_to, etc.... OR dot-walk to a nested reference to sys_user.   Hopefully this makes sense... I'm happy to clarify if not though!