- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2020 07:24 AM
Hi all,
I am trying to create a new dictionary entry in a table and have it be a function field. When I go to create new entry, I do not see the checkbox to select "Function Field".
I am able to do so in my personal instance just fine but cannot find a way to create a function in the instance I am having trouble with.
Any help would be appreciated.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2020 09:18 AM
Is your custom table in any specific scope? Can you try changing the scope of instance to the scope that table is in & then check.
If not, you can use a background script so as to get it checked to True.
Something as below. Try it in DEV first.
var uprec=new GlideRecord('sys_dictionary');
uprec.initialize();
uprec.name='incident'; //replace your table name change_request, etc.
uprec.internal_type='boolean'; //truefalse or string
uprec.column_label='ABC';
uprec.element='xyz';
uprec.function_field=true;
uprec.insert();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2020 09:30 AM
Hi Jaspal,
I just tried the above in background script and it created a new field in my table the now shows function definition.
What is the uprec.element defining? Is this supposed to be the column display name?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2020 09:34 AM
Yes, its the dictionary name for the field that is created named 'ABC' in the script above.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2020 09:36 AM
I see. Thank you very much for the help! This workaround is great.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2020 09:37 AM
Great to know it helped.
I would also suggest you to create a HI Ticket give it a check why the Function Field does not show up & then update us with the same.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2020 09:47 AM
So I may have spoken too soon.. When the background script runs, I see a field being created as a function field, but the column label does not save. When I try to manually add in the column label, the entry will save but will still not show the column label.
When I go to the dictionary entries for that field, the display name shows up in the list but when I click the individual entry it shows nothing in the field.
I think it is the same issue on this thread: https://community.servicenow.com/community?id=community_question&sys_id=d91f03e1dbdcdbc01dcaf3231f96...