Use Expressions to Parse Data at the Edge

In EasyEdge, Expressions can also be used to parse and extract information from raw values such as strings or JSON payloads.

This allows you to transform unstructured or semi-structured data into clean, usable fields directly at the edge, before sending it to your applications.


When to Use Tag vs Data Stream Parsing

Tag Parsing

  • Apply parsing directly at the Asset Tag level when you always want the extracted value to be available as part of the Asset.

  • Example: Parsing a JSON string field to extract a sensor reading and storing it as a dedicated Tag.

Data Stream Parsing

  • Apply parsing at the Data Stream level when you only need the extracted value for a specific application, while keeping the raw data available at the edge.

  • Example: Delivering only a parsed field (such as temperature) to an application, while the full JSON string remains stored locally.


EasyEdge Expression Assistant

The Expression Assistant supports parsing functions as well, making it easier to build and validate string or JSON operations.

  • As you type, the assistant suggests functions like $concat, $format, $parse, $split, and more.

  • Each variable is mapped to a Data Field or Tag, ensuring you know exactly which input you are parsing.

  • Expressions are validated in real time, and errors are clearly shown if the syntax or identifiers are invalid.

💡 Tip: For the full list of available data functions, see the Expressions - Operations Engine page.


Example: Parse a String

In this example, we parse a JSON string to extract a specific field value.

Expression:

Where a is a variable mapped to the original JSON string.


Additional Example: Combining Multiple Operations

ou can also chain multiple data operations together. For example, you may first parse a JSON string and then split the result into different values.

Expression:

This example:

  1. Uses $parse to extract a value from JSON.

  2. Then applies $split to separate the string into parts.


Where to Apply Parsing

Whether you use a single parsing function (like $parse) or combine multiple functions (such as $parse and $split), you can decide where to apply the parsing depending on your project design:

  • Asset Tags → Use when you want the Asset itself to always hold the parsed value, making it directly available at the Edge.

  • Core Tags → Use when you prefer to keep the original Asset untouched, and instead create new Core Tags that store parsed results (especially useful when parsing requires combining inputs across Assets).

  • Data Streams → Use when you only need parsed data delivered to a specific Application, while keeping the original data structure standard at the Edge.

This flexibility ensures you can adapt parsing to the right level of abstraction — at the Asset, at the Core, or at the Application delivery stage.


Key Considerations

  • Use Tag Parsing for values you always want extracted and available in the Asset.

  • Use Data Stream Parsing when only specific applications need the parsed values.

  • Combine multiple parsing operations ($parse, $split, $concat, etc.) to handle more complex data formats.

  • Always validate your expression with the Expression Assistant to ensure correctness before saving.

Last updated