Act

petr_cermak/flatten-json

  • Builds
  • latest 0.0.6 / 2017-10-25
  • Created 2017-10-06
  • Last modified 2017-10-26
  • grade 1

Description

This act extracts all arrays from input JSON and extends their elements with the core object.


API

To run the act, send a HTTP POST request to:

https://api.apify.com/v2/acts/petr_cermak~flatten-json/runs?token=<YOUR_API_TOKEN>

The POST payload will be passed as input for the act. For more information, read the docs.


Example input

Content type: application/json; charset=utf-8

[
    {
        "name": "elem_1",
        "value": ["a", "b", "c"]
    },
    {
        "name": "elem_2",
        "value": ["d", "e"]
    }
]

Readme

act-flatten-json

This act extracts all arrays from input JSON and extends their elements with the core object.

Example input:

[
    {
        "name": "elem_1",
        "value": ["a", "b", "c"]
    },
    {
        "name": "elem_2",
        "value": ["d", "e"]
    }
]

Example output:

[
    { "name": "elem_1", "value": "a" },
    { "name": "elem_1", "value": "b" },
    { "name": "elem_1", "value": "c" },
    { "name": "elem_2", "value": "d" },
    { "name": "elem_2", "value": "e" }
]