- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2018 09:40 AM
Hello,
Does anyone have examples of function fields? I would like to see how they work and what is the syntax of the function definition.
Thanks,
Chad
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2018 10:16 AM
Hi Chad,
Please find below thread it might help to solve your queries:
1. https://docs.servicenow.com/bundle/kingston-application-development/page/build/platform-functions/task/create-function-field.html
2. https://docs.servicenow.com/bundle/kingston-application-development/page/build/platform-functions/concept/platform-support-functions.html
3. https://docs.servicenow.com/bundle/kingston-release-notes/page/release-notes/servicenow-platform/platform-support-functions-rn.html
Thanks,
Bhojraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2020 01:01 PM
Hi James,
I am trying to use a function field (mostly for reporting purposes) as an option so that I do not have to add a column to the database. I need to do conditional logic on this new function Field. The name of my field is Billable. I want it to be a True/False field. This field needs to be able to do conditional logic and return true if it satisfies certain conditions and false if it does not. The conditional logic should return if a particular item of work is billable or not.
I have been able to use a function field with the example given below: glidefunction:concat(short_description, ' ', caller_id.name)
However, I think I need to try something with Scoped GlideDBFunctionBuilder but do not understand the documentation or how to use it. My questions:
- Where is GlideDBFunctionBuilder defined?
- In the Function Definition
- In a Script Include?
- How do you call the GlideDBFunctionBuilder function
- Do you have an example using GlideDBFunctionBuilder that I could look at?
Do you have an example using GlideRecord - addFunction(Object function)?
Thanks,
Ken Hartwigsen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2020 04:24 PM
Where does the code you wrote above go? Does it go in the function definition or in a script include?
Do you have any working code using function fields other than something like
glidefunction:concat(string1,string2)?
Thanks,
Ken
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2020 05:48 PM
Hi Ken,
What I am demonstrating is how to use Db functions to perform Glide queries. For example "show me all active incidents where the length of the short description is less than 8 characters".
I am not demonstrating how to create a function field on a table. I do not have any experience of doing that.
cheers James
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2022 07:39 AM
Hello everyone,
Thanks for your valuable information. I have a small requirement regarding function field.
There are some operations like concat(), add(), dayofweek().
In the same way can we get a year from a date/time field and store in function field.
ex: the date is 2022-02-23, the value in the function field should be 2022.
Thanks.