Skip to content

message.getRowCount

Use when: You want to read values from the modified message during mapping. If you need the original incoming message, use source.getRowCount.

Signature: message.getRowCount()

Returns: Integer count - the number of rows in a message

Get the number of rows in a message.

Note

This method only applies to the following formatted messages: HL7, ASTM, CSV, DICOM.

Parameters

None

Example

// Example: Get the number of rows in a message.

// assumes `message` is an HL7 message model object, like:
//    MSH|^~\&|SendingApp|SendingFacility|ReceivingApp|ReceivingFacility|202311071230||ADT^A01|123456|P|2.3
//    PID|1||123456^^^&1.2.3.4&ISO||Doe^Jane||19850515|F|||123 Elm St^^Somecity^ST^12345||
//    (555)123-4567^PRN^PH^^^555^1234567~
//    (555)987-6543^WPN^PH^^^555^9876543~
//    (555)111-2222^ORN^PH^^^555^1112222

// Get the number of rows in the message
var rowCount = message.getRowCount(); // 2