Skip to Content
Hands-On Edge Analytics with Azure IoT
book

Hands-On Edge Analytics with Azure IoT

by Colin Dow
May 2020
Intermediate to advanced
262 pages
6h 48m
English
Packt Publishing
Content preview from Hands-On Edge Analytics with Azure IoT

The function component

The function component is the second component we will add to the dashboard. Function components are used to run JavaScript on the msg object. We will use the function component to add text to the message coming from the mqtt in component.

To add a function component, do the following:

  1. You will find the function component under the function section on the left. Click and drag the function component onto the canvas.
  2. Connect the output of the mqtt in component to the input of the function component.
  3. Double-click on the function component to enter Edit function node.
  4. Set the Name field to Add to Message.
  5. Set the Outputs field to 2.
  6. Copy and paste the following code into the Function box:
msg.payload = msg.payload + ' ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning Azure IoT Edge Computing: Extending the Cloud to the Intelligent Edge

Beginning Azure IoT Edge Computing: Extending the Cloud to the Intelligent Edge

David Jensen

Publisher Resources

ISBN: 9781838829902Supplemental Content