How to - Parse and produce JSON

In many cases it is requested in a workflow to parse JSON content and extract data out of the JSON structure.

 

For those cases the Collection Manager plugin can be used.

Screen_Shot_2018-01-24_at_01.42.51.png

The action configuration, in its normal form, it's straight forward, simply select "Use json" if you want to have the JSON form of a collation as output.

Screen_Shot_2018-01-30_at_14.11.57.png

NOTE: in input you will always have the possibility to specify either an Hash or a JSON string. Both are supported.

 

Collection Manager exposes an input called Source_JSON_collection that accepts a JSON string.

Screen_Shot_2018-01-24_at_01.42.22.png

As a result the plugin can convert the JSON to an Hash.

Screen_Shot_2018-01-24_at_01.42.35.png

The plugin provides two main features for this case:

  1. Convert a JSON string to an Hash structure. This allows to have the entire JSON content converted to a Ruby Hash element that can then be used later on in the workflow.

    Screen_Shot_2018-01-24_at_01.43.54.png

  2. Extract a specific element of the JSON content and expose it as a single output

    Screen_Shot_2018-01-24_at_01.50.58.png

    Screen_Shot_2018-01-24_at_01.51.48.png

On top the plugin allows you to produce JSON as output by converting an Hash into JSON. This is optional and it will be produced only if the Use JSON option is selected in the configuration.

As an advanced use case, the action can be used to extend a JSON structure by adding other elements.

 

 

0 Comments

Please sign in to leave a comment.
Powered by Zendesk