Reference > Functions reference > Text functions > JSONDeleteElement
 

JSONDeleteElement

Deletes a JSON data element specified by an object name, an array index, or a path.

Format 

JSONDeleteElement(json;keyOrIndexOrPath)

Parameters 

json - any text expression or field that contains a JSON object or array.

keyOrIndexOrPath - any text expression or field that specifies a JSON object name (key), an array index, or a path. See Working with the JSON functions.

Data type returned 

text

Originated in 

FileMaker Pro 16.0

Notes 

This function is not supported in runtime solutions and returns "?".

Example 1 

Deletes an element from a JSON object.

JSONDeleteElement ( "{ \"a\" : 11 , \"b\" : 12 , \"c\" : 13 }" ; "b" ) returns {"a":11,"c":13}.

Example 2 

Deletes an element from a nested JSON object. If the $$JSON variable is set to

{
   "a" :
   {
      "id" : 12,
      "lnk" : false
   }
}

then

JSONFormatElements (
   JSONDeleteElement ( $$JSON ; "a.lnk" )
)

returns

{
"a" :
{
"id" : 12
}
}

Related topics 

Functions reference (category list)

Functions reference (alphabetical list)

About formulas

About functions

Defining calculation fields

Using operators in formulas

Working with the JSON functions