Thank you for your feedback.
Form temporarily unavailable. Please try again or contact docfeedback@servicenow.com to submit your comments.
Versions
  • London
  • Kingston
  • Jakarta
  • Istanbul
  • Helsinki
  • Geneva
  • Store
Close

JsonNode - valueFor(String tableName, String fieldName)

JsonNode - valueFor(String tableName, String fieldName)

Specifies that the JSON property maps to the specified field in the specified table.

Calling this method on a JSON property tells the proxy that the value for this property maps to the specified field in the specified table. The proxy then decides if the field must be encrypted.

This method is available only in an Edge Encryption rule action script.

Table 1. Parameters
Name Type Description
tableName String The table name.
fieldName String The field name.
Table 2. Returns
Type Description
void

This example is from the REST JSON encryption rule.

function RESTJSONAction(request) {
	var urlArray = request.path.split('/');
    var tableName = urlArray[urlArray.length - 1];
	
	if (request.urlParams && request.urlParams.sysparm_query) {
		request.urlParams.sysparm_query.encodedQueryFor(tableName);
	}
	
	var jsonContent = request.getAsJsonContent();
	for (var jsonElementItr = jsonContent.iterator(); jsonElementItr.hasNext(); ) {
		var jsonElement = jsonElementItr.next();
		jsonElement.valueFor(tableName, jsonElement.getName());			
	}
}