Built-in apps
JSON
10min
with the json app in {{product name}} , you can process data or create new content in json format you do not need to establish a connection to use the json app json modules you can use the following modules to build your {{scenario plural lowercase}} aggregators aggregate to json converts the multiple output bundles to a single bundle you need to attach this aggregator module to the source module whose output you want to convert to a single module; for example, the parse json modules give the output in multiple bundles after selecting the source module, select the data structure, and the remaining fields are populated from the source module aggregate to json save the {{scenario singular lowercase}} and run it the output is only one bundle transformers convert json to xml converts the given json data to xml format convert json to xml create json this module helps you create json the fields in this module depends on your data structure the data structure describes how the json data is organized and enables mapping individual json items to other modules in your {{scenario singular lowercase}} select the data structure and enter the field details to create json the data provided in the module returns in the json format in the output parse json data structure the data structure describes how the json data is organized and enables mapping individual json items to other modules in your {{scenario singular lowercase}} if you don't provide the data structure, you may manually run the module and {{product name}} will build the structure from the provided json fill the json string field in the parse json module do not yet connect the modules that follow since {{product name}} doesn't know the structure of the json data, it will not be possible to map data from the parse json module to other modules in your {{scenario singular lowercase}} manually run the {{scenario singular lowercase}} the parse json module will identify the json structure from your provided json you can now connect the modules that follow the items from the parse json module will now be available for mapping collection vs array json string field can contain a collection { } { "name" "peter", "id" 1} in which case, the output will be a single bundle containing the items of the collection or it can contain an array \[ ] \[ { "name" "peter", "id" 1 }, { "name" "mike", "id" 2 }] in which case the output will be a series of bundles, each bundle containing one array's item simulate module output using parse json {{product name}} allows you to use the data from the existing module to test your {{scenario singular lowercase}} you can run this operation using the parse json module run the module whose output data you want to copy using the parse json module click the resulting output above the module click download output bundles from the dropdown menu a window containing the original module's output bundles in json format pops up parse json step 3 copy the window's content and click close parse json step 4 insert the tools > parse json module after the original module, open its configuration, and paste the copied json data in step 4 into the json string field parse json step 5 unlink the original module from the {{scenario singular lowercase}} do not delete the original module parse json step 6 execute the mock up json module and use its output instead of the original module's output in your {{scenario singular lowercase}} build and test your {{scenario singular lowercase}} once you are done with the testing, change the mapping from the mock up module to the original module across the whole {{scenario singular lowercase}} with the devtool's remap source tool put the original module back before the mock up json module and remove the json module parse json example in the remap source section, it is not necessary to fill the module to edit field unless you do not want to remap all values from the original module in the whole {{scenario singular lowercase}} transform to json transforms any object to json let us assume that the data records you wish to transform to json format are in a google spreadsheet here is the procedure on how to transform the data records to json format place the google sheets > select rows module in your {{scenario singular lowercase}} to get the data set up the module to retrieve rows from your google spreadsheet and set the maximum number of returned rows to a small number but larger than one for testing purposes (e g , three) run the google sheets module (right click it and choose "run this module only") and verify its output connect the array aggregator module after the google sheets module in the module's setup, choose the google sheets module in the source node field leave the other fields as they are for the moment connect the json > create json module after the array aggregator module the module's setup requires a data structure that describes the json format click the add button to open the data structure setup the easiest way to create this data structure is to generate it automatically from a json sample click the generator button and paste your json sample to the sample data field { "books" \[ { "id" "id", "title" "title", "author" "author" } ]}transform to json step 3 click save the specification field in the data structure setup should now contain the generated structure change the name of your data structure to something more specific (e g , "books") and click save a field corresponding to the root array attribute should appear mappable in the json module's setup click the map button next to the field and map the array\[] item output from the array aggregator module transform to json step 6 click ok to close the json module's setup open the setup of the array aggregator module change the t arget structure from custom to the json module's field corresponding to the root array attribute map items output from the google sheets module to the appropriate fields transform to json step 8 click ok to close the array aggregator module's setup run the {{scenario singular lowercase}} the json module should output the correct json format open the setup of the google sheets module and increase the maximum number of returned rows number to be larger than the number of rows in your spreadsheet to process all the data the resulting json can then be used as a body of an http request, returned as a webhook's response, etc