beta
cables is under heavy development.
There might be one or another bug, please let us know about it!

ArrayGetArrayValuesByPath Op

Ops.Json.ArrayGetArrayValuesByPath


ArrayGetArrayValuesByPath
Namespace: Ops.Json

Op author: cables

Outputs all the values of the properties of an array of objects given a path


summary (oneliner)

useful to interate over nested data structures.

the path defines the way to the first object. this op will then try to iterate over the array that contains the object with the given property and return all the values fo each object in the array.

given an array like this:

[
    [
        {
            "firstName": "Gordon",
            "lastName": "Freeman"
        },
        {
            "firstName": "Eli",
            "lastName": "Vance"
        }
    ],
    [
        {
            "firstName": "Alyx",
            "lastName": "Vance"
        },
        {
            "firstName": "G",
            "lastName": "Man"
        }
    ]
]

a path of 0.0.firstName will result in this array:

[
  "Gordon",
  "Alyx",
]


doc

issues

youtube id

caniuse query

collections

related ops

Inputs

Array (Array)

Path (String)

path to first array field (i.e. "data.0.firstName")


Outputs

Output (Array)

array of values


Found (boolean Number)

Caught a mistake or want to contribute to the documentation?

Edit Documentationcancel save

ArrayGetArrayValuesByPath - Example

Open Example In Editor


Changelog


cloned op from Ops.Json.ObjectGetArrayValuesByPath
2021-01-08 - cables

Ops.User.cables.ArrayGetArrayValuesByPath renamed to Ops.Json.ArrayGetArrayValuesByPath
2021-01-08 - cables

Examples using ArrayGetArrayValuesByPath ()

Public Patches using ArrayGetArrayValuesByPath ()