Which function would you call to obtain a system property value?

Prepare for the ServiceNow CAD Exam with comprehensive flashcards and multiple-choice questions. Each query offers hints and explanations. Ensure your success on the exam!

Multiple Choice

Which function would you call to obtain a system property value?

Explanation:
In server-side scripting in ServiceNow, you read a system property value using the GlideSystem object, often referenced as gs. The getProperty method on gs fetches the value of a property stored in the sys_properties table. You provide the property's name, and you can also supply a default value if the property isn’t set. This is the standard way to access system properties from server-side code. For example: var timeout = gs.getProperty('glide.app.timeout', '30'); If the property isn’t defined, timeout will be '30'. Other options aren’t valid in this context: System.getProperty is a Java method and isn’t the API used in ServiceNow’s JavaScript scripting environment. getProperty on its own lacks a context or object to invoke the method from, so it wouldn’t directly retrieve a property. serviceNow.getProperty isn’t a recognized API in ServiceNow scripting.

In server-side scripting in ServiceNow, you read a system property value using the GlideSystem object, often referenced as gs. The getProperty method on gs fetches the value of a property stored in the sys_properties table. You provide the property's name, and you can also supply a default value if the property isn’t set. This is the standard way to access system properties from server-side code.

For example: var timeout = gs.getProperty('glide.app.timeout', '30'); If the property isn’t defined, timeout will be '30'.

Other options aren’t valid in this context: System.getProperty is a Java method and isn’t the API used in ServiceNow’s JavaScript scripting environment. getProperty on its own lacks a context or object to invoke the method from, so it wouldn’t directly retrieve a property. serviceNow.getProperty isn’t a recognized API in ServiceNow scripting.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy