JsonNode - encodedQueryFor(String tableName)

Specifies that the value of the JSON property is an encoded query for the specified table.

Calling this function on an JSON node tells the proxy that the value is an encoded query for the specified table. The proxy parses the encoded query and encrypts the values for fields in the encoded query that need to be encrypted.

Table 1. Parameters
Name Type Description
tableName String A table 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());			
	}
}