Iterating Over Message Segments
To iterate over all segments, follow this example:
for each (segment in msg.children()) {
if (segment.name().toString() == "ORC") {
// Do something…
}
}
To iterate through specifically named segments, use this formula:
for each (segment in msg..OBX) {
// Do something…
}
Note that although JavaScript can be used to iterate through message segments, you may find it easier to use the Iterator Rule / Step instead.