YouTube Connector 25.2
YouTube Connector Help

# existsByPath

The `existsByPath` method checks whether a specified path exists in the JSON array.

## Syntax

    existsByPath( path )

## Arguments

Argument | Description
--- | ---
`path` | (string) The path to check. Construct the path from array indexes and object attribute names, and use a slash (`/`) as the separator. If an object attribute name includes a slash, then escape the slash with a backslash, for example `"one\\/two"`. Notice that you must also escape a backslash with another backslash.

## Returns

(Boolean) Returns `true` if the path exists, `false` otherwise.

## Example

    local myJsonObject = LuaJsonObject:new( { product="IDOL" , version=11 } )
    local myJsonArray = LuaJsonArray:new("zero",1,2,myJsonObject)

    print (myJsonArray:existsByPath("3/product"))
    -- true (LuaJsonArrays are zero-indexed)

## See Also

- exists

Copyright 2025 Open Text
Version 25.2 | Last updated April 2025

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to MFI-swpdl.idoldocsfeedback@opentext.com.

We appreciate your feedback!

Product: Knowledge Discovery YouTube Connector 25.2

Topic Title: existsByPath