Removed in ArduinoJson 6.20: use JsonDocument::operator[] instead.


JsonDocument::getElement() gets the value at the specified index; it reproduces JsonArray::getElement().

Instead of this function, you can use JsonDocument::operator[] which offers a more intuitive syntax.


JsonVariant getElement(size_t index);


index: the index of the value in the array.

key: the key of the value in the object.

Return value

JsonDocument::getElement() returns a JsonVariant that points to the requested value.

JsonDocument::getElement() return null when no match is found.

See also