Heisenware Docs
Go to websiteGet a demo
  • 👋Welcome
  • Getting started
  • Release Notes
    • v84 - Get in the flow
    • v83 - Beauty treatment
    • v82 — Fully distributed
    • v81 — Removing old cruft
    • v80 — Chicks on fire
    • v79 — Nothing is forever
    • v78 — Keep moving
    • v77 — More intelligence
    • v76 — Well cooked
  • Build & Deploy Apps
    • Overview
    • Flow Builder
      • Nodes (Functions)
        • Inputs
        • Trigger
        • Output
      • Function Extensions
        • Modifier
        • Filter
        • Error handler
        • Memorizer
      • Objects & Instances
      • Utilities
        • Basic Functions
        • PDF functions
        • Circular buffer
        • Timer
        • Counter
    • Integrations
      • Protocol Connectors
        • GraphQL
        • HTTP/REST
        • MQTT
        • OPC UA
          • Heidenhain PLCs with OPC UA
        • RS-232/485
        • Siemens S7
      • Data Connectors
        • File
        • Relational Database
        • Time Series Database (WIP)
      • API Connectors
        • OGC SensorThings API
        • Operating System
        • Zebra RFID IoT Connector
      • Agent / (Edge Connector)
      • Calling Custom Code
    • UI Builder
      • Input Widgets
        • Form
        • File Upload
        • Photo
        • Signature
        • Barcode / QR-Code (WIP)
        • Document Scan (WIP)
      • Display Widgets
        • Chart
        • Chat
        • Circular Gauge
        • Data Grid
        • Linear Gauge
        • Map
        • Media View
        • Progress Bar
        • Sparkline
        • Status Lamp
        • Toast
        • Value Box
        • Kanban Board
        • Data Tiles
        • Pie Chart
        • Sankey
      • Buttons
      • Text Box
      • Images
      • Icons
    • Communication Interfaces
      • Email Notifications
      • OPC UA Server
    • Data & File Storage
      • Internal InfluxDB
      • Internal PostgreSQL
      • File Server
    • App Appearance
      • Pages
      • In-App Navigation
      • Screens & Devices
      • Theming
    • Simulation & Testing
      • Simulating Events
      • Simulating Data
    • PDF Templates
    • RAG-based Chatbot
    • Deployment
  • Manage Apps
    • Overview
    • Manage Apps
      • General Settings
      • Users and Access
      • Distribution & Versioning
    • Manage Integrations
    • Manage Account
      • Account Structure
      • Members
      • Workspaces
  • TUTORIALS
    • Build Your First Heisenware App
  • Connect Heidenhain CNC with OPC UA Support
  • Related links
    • Website
    • Privacy policy
    • Imprint
Powered by GitBook
On this page
  • Working with modifiers
  • Types
  • JSONata
  • JavaScript expression
  1. Build & Deploy Apps
  2. Flow Builder
  3. Function Extensions

Modifier

Last updated 6 days ago

The modifier is a very simple but powerful tool for on-the-fly data modification and transformation using code. It falls under the category of . Adding and deleting modifiers follows the same process as with the other extensions. Click the + icon behind an output, modifier, filter, or error handler, and choose the Modifier option.

Working with modifiers

Modifiers work akin to , enabling you to leverage their value by linking to another function or a widget. The modifiers value is recalculated from the previous value after every trigger. The previous value can originate from an output, an , a , or another modifier.

You can incorporate as many consecutive modifiers as needed.

To execute two or more independent modifications for the same output value, you can use the parallel modifier in one of two ways:

  1. Click the + icon behind a modifier

    • Select Parallel Modifier

  2. Click the + icon behind the function

    • Add a second Modifier

You can add as many parallel modifiers as required for your specific needs.

Types

The choice between JavaScript and JSONata often depends on your programming background. JavaScript may be more comfortable for those familiar with programming, while JSONata can be easier for beginners.

To switch between JSONata and JavaScript:

  1. Right-click on an existing modifier

  2. Select Jsonata for JSONata or Expression for JavaScript

When switching the modifier type, its content is deleted.

JSONata

JSONata is a lightweight query and transformation language tailored for JSON data, and has been seamlessly integrated into Heisenware. JSONata offers support for sophisticated query expressions with minimal syntax, as well as its built-in operators and functions for efficiently manipulating and combining data.

The two most essential and frequently used aspects of it are discussed below.

Referencing

To refer to the value of a previous box, whether it's an output or a modifier itself, utilize the $ sign.

For JSONata functions, however, the previous value is automatically considered as an argument, eliminating the need to explicitly fill it into the brackets.

Filtering objects

JSONata simplifies the task of filtering JSON objects significantly. You can achieve this by specifying a key in the modifier to filter it from an object.

JavaScript expression

A JavaScript expression is a unit of code that evaluates to a value. The modifier allows the use of evaluation expressions and integrates them seamlessly.

The variable x contains the value of the preceding output or modifier and should not be used for any other purpose.

Pro tip: Immediately Invoked Function Expressions (IIFE) are supported as well.

There are and modifiers. By default, a modifier is set to JSONata.

The and the are the best way to familiarize yourself with JSONata and its possibilities.

The documentation for JavaScript is a great starting point to get to know all the possibilities the modifier features has in store for you.

JSONata documentation
exerciser
expressions and operators
JSONata
JavaScript expression
output
error handler
filter
JSONata Documentation · JSONata
Expressions and operators - JavaScript | MDNMDN Web Docs
function extensions
Adding a parallel modifier
Switching between JSONata and JavaScript
$ sign as reference for context
JSONata function in the modifier
Object filtering with JSONata
Array filter expression in JavaScript
Logo
Logo