Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Some value fields output data, which is 1-many, i.e. sometimes a value field can output a single data point (string or number), or one JSON object, or an array of data.

isArray signifies that a value field's output is always output as an array.

Example:

The value field 

Image Added
With this added value field, the returned search result is (the response contains data other than this single value field, but that data has been omitted for clarity's sake):


Code Block
languagejs
linenumberstrue
{
    "items": [
        {
            //The value field
            "Keywords": [
                "Keyword1",
                "Keyword2"
            ]            
        },
        {
			//The value field
            "Keywords": "Keyword2"       
        }
    ],
    "success": true,
    "total": "2"
}


The result contains two objects. Each of these objects have a "Keywords" property. The first object has two keywords:

Code Block
languagejs
linenumberstrue
"Keywords": [
                "Keyword1",
                "Keyword2"
            ]


The second object has only one keyword:

Code Block
languagejs
linenumberstrue
"Keywords": "Keyword2"


If we edit the value field, so that isArray is checked, the returned result is:

Code Block
languagejs
linenumberstrue
{
    "items": [
        {
            //The value field
            "Keywords": [
                "Keyword1",
                "Keyword2"
            ]
        },
        {
            //The value field
            "Keywords": [
                "Keyword2"
            ]
        }
    ],
    "success": true,
    "total": "2"
}

Now both of the objects' Keywords property is an array.