• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
CDP Studio logo

CDP Studio

The no-code and full-code software development tool for distributed control systems and HMI

  • Doc
  • Why CDP
    • Software developers
    • Automation engineers
    • Managers
  • Products
    • Automation Designer
    • HMI Designer
    • Maritime HMIs
  • Services
  • Use cases
  • Pricing
  • Try CDP

CDP Studio Documentation

  • Framework - Sequencer
  • JSONQuery

JSONQuery

JSONQuery

The JSONQuery is an operator, that allows to query any value from the input JavaScript Object Notation (JSON) string using JSON Pointer syntax.

JSON Pointer can be used to specify a specific object within a JSON document. JSON Pointer uses a relatively simple string syntax to represent the path to any JSON element. The JSON Pointer syntax consists of segments separated by /. Each segment can be either an object key or an array index (starting from zero).

Arguments

NameDescription
InThe JSON-formatted string
OutValue that was located from the input by the Query

Properties

NameDescription
QueryQuery string in the JSON Pointer syntax identifying the value to search from the input JSON. If the value can not be found, the output value is set to empty. If Query is left empty, then the input JSON value is simply copied to the output.

Example

Let's consider this JSON document as an input for some example queries:

{
  "name": "Jan",
  "age": 30,
  "address": {
    "city": "Oslo",
    "postalCode": "1001"
  },
  "pets": [
    {"name": "Fido", "type": "Dog"},
    {"name": "Whiskers", "type": "Cat"}
  ]
}

Below is a table with some JSON Pointer queries and results for this JSON:

Example QueryValue that will be foundDescription
/nameJanSearch for the name attribute
/address/cityOsloSearch for the city attribute within the address object
/pets/1/nameWhiskersSearch for the second element name attribute in the pets array
/pets[{"name": "Fido", "type": "Dog"},{"name": "Whiskers", "type": "Cat"}]Retrieve all elements from the pets array
/pets/0{"name":"Fido","type":"Dog"}Retrieve the first element from the pets array

See also JSONDecode and Argument.

The content of this document is confidential information not to be published without the consent of CDP Technologies AS.

CDP Technologies AS, www.cdpstudio.com

Get started with CDP Studio today

Let us help you take your great ideas and turn them into the products your customer will love.

Try CDP Studio for free
Why CDP Studio?

CDP Technologies AS
Hundsværgata 8,
P.O. Box 144
6001 Ålesund, Norway

Tel: +47 990 80 900
E-mail: info@cdptech.com

Company

About CDP

Contact us

Services

Partners

Blog

Developers

Get started

User manuals

Support

Document download

Release notes

My account

Follow CDP

  • LinkedIn
  • YouTube
  • GitHub

© Copyright 2025 CDP Technologies. Privacy and cookie policy.

Return to top