PROTOBUF.ENCODE
Premium
Encodes 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.ENCODE(Message, MessageType, ProtobufFile, [Target])
Arguments
Name | Type | Description |
---|---|---|
Message | String | The message to encode |
MessageType | String | The message type to use for encoding |
ProtobufFile | String | Path to the Protobuf file. When using Docker, the file has to be mounted into the container before using it here. |
Target (optional) | Target | The target where to write the encoded Protobuf message to |
Return
The encoded Protobuf message
Examples
For this example to work, the file "sparkplug_b.proto" must be located in the "/protobuf" directory.
Formula | Result | Comment |
---|---|---|
| The encoded message | Encode the JSON in A1:B2 using the Sparkplug B Protobuf file and return the encoded message |