cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1201
Views
5
Helpful
1
Replies

DGLux Convert table to JSON

vkuruva
Cisco Employee
Cisco Employee

DGLux Convert table to JSON

I am trying to create a JSON string from table data in dataflow editor. With out writing javascript is there a simple way to convert table data into JSON string.

1 Reply 1

matgibbs
Cisco Employee
Cisco Employee

You want to use a "Make Object" block (under "Logic"). It will take in each of the fields from the table and generate JSON as the output. See here for more info on page 91:

https://www.cisco.com/c/dam/en/us/td/docs/cloud-systems-management/cisco-edge-fog-fabric/1_6_0/Kinetic-EFM-1-6-0_DataflowEdUG.pdf

 

Basically:

  1. Add the "Make Object" block to your dataflow
  2. Click the plus to create an input parameter and match it to a column name and data type from your table
  3. Repeat step 2 as necessary to define all the table parameters you need
  4. Open the table and drag the fields to the input parameters you just created on the "Make Object" block
  5. The "outputObj" property will have the JSON string you want