JSON modules

The Adobe Workfront Fusion JSON app provides modules to process data in JSON format so that Adobe Workfront Fusion can further work with the data content, or create new JSON content.

Access requirements

You must have the following access to use the functionality in this article:

Adobe Workfront plan*
Pro or higher
Adobe Workfront license*
Plan, Work
Adobe Workfront Fusion license**

Current license requirement: No Workfront Fusion license requirement.

Or

Legacy license requirement: Workfront Fusion for Work Automation and Integration, Workfront Fusion for Work Automation

Product

Current product requirement: If you have the Select or Prime Adobe Workfront Plan, your organization must purchase Adobe Workfront Fusion as well as Adobe Workfront to use functionality described in this article. Workfront Fusion is included in the Ultimate Workfront plan.

Or

Legacy product requirement: Your organization must purchase Adobe Workfront Fusion as well as Adobe Workfront to use functionality described in this article.

To find out what plan, license type, or access you have, contact your Workfront administrator.

For information on Adobe Workfront Fusion licenses, see Adobe Workfront Fusion licenses.

Parse JSON

Data structure

The Data structure describes how the JSON data is organized and enables the mapping of individual JSON items to other modules in your scenario. If you don’t provide the Data structure, you may manually execute the module and Workfront Fusion will build the structure from the provided JSON:

  1. Add the Parse JSON module to a scenario.
  2. In the JSON String field, enter the JSON from which you want to build a data structure.
  3. Do not connect other modules to the Parse JSON module yet. Because Workfront Fusion does not yet know the structure of the JSON data, it is not yet possible to map data from the Parse JSON module to other modules in your scenario.
  4. Manually run the scenario. This allows the Parse JSON module to identify the JSON structure from the JSON you have provided.
  5. You can now connect following modules. The items from the Parse JSON module are now available for mapping.

For more information, see Data structures in Adobe Workfront Fusion.

Collection vs. Array

If the JSON string field contains a collection { ... }, The output is a single bundle containing the items of the collection.

INFO
Example:
code language-none
{
    "name" : "Peter",

"ID" : 1

If the JSON string field contains an array [ ... ], the output is a series of bundles. each bundle contains one element of the array.

INFO
Example:
code language-none
[
  {
    "name" : "Peter",
    "ID" : 1
  },

JSON modules and their fields

When you configure JSON modules, Workfront Fusion displays the fields listed below. Along with these, additional JSON fields might display, depending on factors such as your access level in the app or service. A bolded title in a module indicates a required field.

If you see the map button above a field or function, you can use it to set variables and functions for that field. For more information, see Map information from one module to another in Adobe Workfront Fusion.

Aggregate to JSON

This aggregator module aggregates output from a previous module into JSON.

Source module
Select the module that outputs the data that you want to aggregate to JSON.
Data structure
Select the data structure that you want to use to create JSON. The data structure determines what other fields are available in this module. For more information, see Data structure in this article.
Indentation
Select whether you want to indent the JSON using tabs, two spaces, or four spaces.
Group by
Define an expression that you want to group the aggregated output by. This expression can contain one or more mapped items. The aggregated data is then separated into groups using this expression's value. Each group outputs as a separate bundle with a key (the evaluated expression) and a value (the aggregated text). You can use the key as a filter in subsequent modules.
Stop processing after an empty aggregation
Enable this option to stop the scenario when there are no results.

Convert JSON to XML

This action module converts a JSON string to XML.

JSON string
Enter or map the JSON that you want to convert into XML.

Parse JSON

This action module parses a JSON string into a data structure, which allows you to access the data inside the JSON string.

Data structure
Select the data structure that you want to use to create JSON. For more information, see Data structure in this article.
JSON string
Enter or map the JSON that you want to parse.

Create JSON

This action module creates JSON from a data structure.

Data structure
Select the data structure that you want to use to create JSON. For more information, see Data structure in this article.

Transform JSON

This action module transforms an object into a json string.

Object
Enter or map the object that you want to transform into JSON.

Transforming data records to JSON

INFO
Example: The following example shows how to transform data records from Google Sheets to JSON format:
  1. Place the Google Sheets > Select rows module in your scenario to fetch the data. Set up the module to retrieve rows from your Google spreadsheet. Set the​ Maximum number of returned rows to a small number, but larger than one for testing purposes (Example, three). Execute the Google Sheets module by right-clicking it and choosing “Run this module only.” Verify the output of the module.

  2. 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.

  3. Connect JSON > Create JSON module after the Array Aggregator module. The module’s setup requires a Data structure that describes the JSON format. Click Add to open the Data structure setup. The easiest way to create this Data structure is to generate it automatically from a JSON sample. Click Generator and paste your JSON sample to the Sample data field:

    Example:

    code language-none
    
    
    {
    
    
    
    
    “books”: [
    
    
    
    
    {
    
    
    
    
    “id”: “ID”,
    
    
    
    
    “title”: “Title”,
    
    
    
    
    “author”: “Author”
    
    
    
    
    }
    
    
    
    
    ]
    
    
    
    
    }
    
  4. Click Save. The Specification field in the Data structure now contains the generated structure.

  5. Change the name of your Data structure to something more specific and click Save. A field corresponding to the root array attribute appears as a mappable field in the JSON module’s setup.

  6. Click the Map button next to the field and map the Array[] item from the Array aggregator output to it.

  7. Click OK to close the JSON module’s setup.

  8. Open the setup of the Array Aggregator module. Change the Target structure from Custom to the JSON module’s field corresponding to the root array attribute. Map items from the Google Sheets module to the appropriate fields.

  9. Click OK to close the Array Aggregator module’s setup.

  10. Run the scenario.

    The JSON module outputs the correct JSON format.

  11. 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.

Troubleshooting

Cannot map data from the Parse JSON module

Make sure that the JSON content is properly mapped into the Parse JSON module and that the data structure is correctly defined. For more information, see Transforming data records to JSON in this article.

Module fails when using conditional statements in JSON

When using conditional statements such as if in your JSON, put the quotation marks outside of the conditional statement.

INFO
Example:
recommendation-more-help
5f00cc6b-2202-40d6-bcd0-3ee0c2316b43