Context & global variables
If you are going to create your own parser, you need to understand how context works.
When you start writing your own Payload Parser, you can use certain globals variables in your code. Think of these global variables as variables that you can access anywhere without actually creating them, like the module keyword or the process keyword in Node.js.
These global variables can vary from simple objects to complex functions or arrays. To see a list of the global variables available, you can always check the Payload Parser tab in the device details.
The most important variable is the payload variable. This variable is always available anywhere on the code. It is an array with objects in the TagoIO format and with it you can edit, remove or even add more payload variables as you wish.
Our team can add more global variables, depending on your needs. Just let us know.
Learn how to build your own parser function.