How to get a specific value from an unknown number of JSON representations? I am using ArduinoJson and ESP8266HTTPClient.
Say I have a DynamicJsonDocument that has an unknown number of entries with information on different persons:
[
    {
        &quot;ID&quot;: &quot;12345&quot;, 
        &quot;name&quot;: &quot;John Smith&quot;, 
        &quot;Address&quot;: &quot;Street 1&quot;
    }, 

    .
    .
    .

    {
        &quot;ID&quot;: &quot;00345&quot;, 
        &quot;name&quot;: &quot;Paul Anderson&quot;, 
        &quot;Address&quot;: &quot;Street 2&quot;
    }
]


I would like to somehow store the values associated with the key &quot;name&quot; for all the different persons. For example, have something like:
String name1 = &quot;&quot;;
...
String nameN = &quot;&quot;;

.
.
.

Serial.println(name1);
...
Serial.println(nameN);


To print a list of all the names:
John Smith
Paul Anderson

The only information of the JSON I have beforehand is the keys each entry will have. I do not know how many entries there will be.
How can I go about this?
EDIT: Why I want to do this:
I am using the ESP as a client to get information from a server in the form of a JSON similar to what I wrote above. At the same time, I am serving a simple HTML website by doing server.send(200, &quot;text/html&quot;, HTML_code); using the ESP as an AP. I was able to just cram the whole JSON into the HTML as text, but I would like to just have specific information from the JSON, as explained above.
I am aware what I am doing is far from elegant or the &quot;correct way to do it&quot;, but I am learning all of this, so any criticism and help is more than welcome :)
Directly from the ArduinoJson Assistant:
// Stream&amp; input;

StaticJsonDocument&lt;384&gt; doc;
deserializeJson(doc, input);

for (JsonObject elem : doc.as&lt;JsonArray&gt;()) {
  const char* ID = elem[&quot;ID&quot;]; // &quot;12345&quot;, &quot;13244&quot;, &quot;00345&quot;
  const char* name = elem[&quot;name&quot;]; // &quot;John Smith&quot;, &quot;Jason Statham&quot;, &quot;Paul Anderson&quot;
  const char* Address = elem[&quot;Address&quot;]; // &quot;Street 1&quot;, &quot;Street 2&quot;, &quot;Street 3&quot;
}

See also:

How to use ArduinoJson with HTTPClient?
How to deserialize a very large document?