Skip to main content
Version: Streamsheets 3.0

PROTOBUF.DECODE

Premium

Decodes a Protobuf message. When using Docker, mount the Protobuf file before using it. For a Protobuf file called sparkplug_b.proto this might look like this in the volumes section of your docker-compose.yml: - ./sparkplug_b.proto:/protobuf/sparkplug_b.proto.

Syntax

=PROTOBUF.DECODE(Message, MessageType, ProtobufFile, [Target])

Arguments

NameTypeDescription
MessageStringThe message as buffer to decode
MessageTypeStringThe type of the message
ProtobufFileStringPath to the Protobuf file. When using Docker, the file has to be mounted into the container before using it here.
Target (optional)TargetThe target where to write the result to

Return

TypeDescription
StringThe decoded Protobuf message

Examples

For this example to work, the file "sparkplug_b.proto" must be located in the "/protobuf" directory.

FormulaResultComment
=PROTOBUF.DECODE(INBOXDATA.data,"Payload", "/protobuf/sparkplug_b.proto", INBOX("Sheet1"))
The decoded messageDecode the message in the inbox using the Sparkplug B Protobuf file and write the decoded message to the inbox of "Sheet1"