Get Data As a String from a Path of Targeted JSON Pointer


ASTER::EXPRESSION::JSON::Obtain Data As a String using Targeted JSON Pointer.

Data is obtained as a string from the pre-specified target path.

Data other than string type is implicitly cast, and even numeric types are obtained as strings. For data structures, a dump output without formatting specifications is obtained.

ExStrTgtPath( "ASTER" )

Parameter: Noone

The path is obtained from the pre-specified target and used to retrieve string data, so no parameter input is required from the CF25 Expression Editor.


Show JSON & example Params..
{
    "A":"TEST",
    "B":123456,
    "C":[1,2,3]
}
Type Targeted JSON Pointer Result
Target data type is a string “/A” “TEST”
Target data type is numeric “/B” “123456”
Target data type is array “/C” “[1,2,3]”
  • Numbers are converted to strings, and arrays are serialized dumps.

  • To retrieve specific elements from an array, use AsStr using TgtJSP isArr.


About Targeted JSON Pointer

It's a mechanism similar to browser bookmarks that simplifies path specification.

This document uses the abbreviation TgtJSP.

Sending long paths with JSON Pointer every time in loop processing is really inefficient.

Since it's the same path, you only need to send it once beforehand and reuse it.

Consider retrieving data from arrays deep within a JSON structure. If you only need to specify indexes to retrieve 10 pieces of data, it might not be zero-emission, but it's very ecological.

Targeted JSON Pointer was designed to reduce the number of path transmissions, lessen the string processing burden related to paths, and streamline data retrieval processes.