Skip to content

message.setAllJSONBooleans

Signature: message.setAllJSONBooleans(nodePath, value)

Returns: void

Find all nodes that match nodePath and set each nodes value.

Note

This method only applies to JSON-formatted messages.

Parameters

Type Name Description Default
String nodePath the node path (XPath, HPath, Column ID, etc.)
String or Boolean value the new node value

Example

// Examples of how to use setAllJSONBooleans
// Given a JSON message like:
message = qie.createJSONMessage(
   JSON.stringify(
      {
         "people": [
            {
               "name": "Jessie",
               "has been tested": true
            },
            {
               "name": "Sarah",
               "has been tested": true
            }
         ]
      }
   )
);


// Example: value as Boolean
message.setAllJSONBooleans(
   "/people/has been tested", // nodePath - all matching nodes
   false                      // value (Boolean)
);


// Example: value as String (will be converted to Boolean)
message.setAllJSONBooleans(
   "/people/has been tested",
   "true"                    // value (String → Boolean)
);

// Resulting JSON:
// {
//     "people": [
//         { "name": "Jessie",  "has been tested": true },
//         { "name": "Sarah", "has been tested": true }
//     ]
// }