Create calculated field in servicenow

georgechen
Kilo Guru

Hi folks,

Just wondering if anyone can help with a calculated fields in ServiceNow,     In RDBMS system we can create alias fields to achieve this (e.g birthday time = getTime(dob)) , whereas in ServiceNow is there a feature to create a virtual field that is a based on a calculation e.g SLA = 2016-07-14 12:38:09, and SLA Date is 2016-07-14,

A potential solution is to make a Business rule to truncate the date but it will overwrite the field value.

Any advice would be appreciated.

Kind regards,

George

5 REPLIES 5

ramireddy
Mega Guru

Yes, you have calculated columns feature available in SNOW. While creating a column, click on "Advanced view", you can see "calculated value" section. You can enter the expression.



In your case, as you are just trying to convert "Date/Time" to date in your calculated field, I suggest just put the expresson as "current.yourdatetimecolumnname". It should automatically convert to date.



Screen Shot 2016-07-14 at 11.55.59 am.png


Thanks a lot Ram, this is exactly what I was after though I was also thinking of business rule; this feature is simpler!


Hey George,



Additional info on calculated field can be found here.


System Dictionary - ServiceNow Wiki


The SN Nerd
Giga Sage
Giga Sage

Please note that due to the nature of Calculated Fields, you cannot report on them.


If reporting is a requirement you will have to implement via business rules.



ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022