Title: Problem with array and items
Last modified: November 11, 2022

---

# Problem with array and items

 *  Resolved [major67](https://wordpress.org/support/users/major67/)
 * (@major67)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/problem-with-array-and-items/)
 * Hallo,
 * ich komme bei folgendem JSON nicht weiter:
 * [https://www.pegelonline.wsv.de/webservices/rest-api/v2/stations/2730010.json?includeTimeseries=true&includeCurrentMeasurement=true](https://www.pegelonline.wsv.de/webservices/rest-api/v2/stations/2730010.json?includeTimeseries=true&includeCurrentMeasurement=true)
 * Ich möchte gerne die Werte von ‘value’ einzeln haben, also in dem Fall einmal
   den Pegelstand, einmal die Abflussmenge, einmal die Wassertemperatur.
 * Werte ich per subloop-array den ganzen array aus, bekomme ich ALLE Werte hintereinander,
   was wenig Sinn macht, ich möchte ja nur einen davon.
 * [jsoncontentimporter url=http://www.pegelonline.wsv.de/webservices/rest-api/v2/
   stations/2730010.json?includeTimeseries=true&includeCurrentMeasurement=true debugmode
   =10 basenode=timeseries]{subloop:currentMeasurement:1}{value}{/subloop:currentMeasurement}[/
   jsoncontentimporter]
 * Was für mich logisch wäre:
    [jsoncontentimporter url=http://www.pegelonline.wsv.
   de/webservices/rest-api/v2/stations/2730010.json?includeTimeseries=true&includeCurrentMeasurement
   =true debugmode=10 basenode=timeseries]{timeseries.1.currentMeasurement.value}[/
   jsoncontentimporter] Funktioniert aber nicht.
 * Seit gestern kratze ich mir den Kopf…

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [berkux](https://wordpress.org/support/users/berkux/)
 * (@berkux)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/problem-with-array-and-items/#post-16190658)
 * Hallo,
 *     ```
       [jsoncontentimporter url=http://www.pegelonline.wsv.de/webservices/rest-api/v2/stations/2730010.json?includeTimeseries=true&includeCurrentMeasurement=true oneofthesewordsmustbein="WASSERSTAND" oneofthesewordsmustbeindepth="2" basenode="timeseries"]
       {longname}: {subloop:currentMeasurement:1}{currentMeasurement.value}{/subloop:currentMeasurement}
       [/jsoncontentimporter]
       ```
   
 * wäre eine Mgöichkeit, wobei {longname} im auszugebenden Text enthalten sein muss.
 * Die “logischere” / “bessere” Notation ist nicht mit der kostenlosen Variante 
   des Plugins machbar.
 * Gruß
    Bernhard
 *  Thread Starter [major67](https://wordpress.org/support/users/major67/)
 * (@major67)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/problem-with-array-and-items/#post-16190697)
 * Hallo,
 * vielen Dank. Klar, das funktioniert, allerdings ist das relativ unbrauchbar, 
   wegen des {longname}-“Zwangs”. Bei Wasserstand könnte man damit leben, bei “ABFLUSS_ROHDATEN”
   und “WASSERTEMPERATUR ROHDATEN” wird es aber unelegant.
 * Schade, weil das Quell-JSON jetzt gar nicht so kompliziert ist und in PHP leicht
   zu parsen.
 * Würde die PRO-Version das vereinfachen ?
 * Gruß,
    Marco.
 *  Plugin Author [berkux](https://wordpress.org/support/users/berkux/)
 * (@berkux)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/problem-with-array-and-items/#post-16190803)
 * Hallo Marco,
 * in der Tat ist das nicht perfekt. Das kostenlose Plugin nimmt JSON so wie es 
   ist.
 * Falls Du PHP kannst: Du kannst ein Script bauen, das [http://www.pegelonline.wsv.de/webservices/rest-api/v2/stations/2730010.json?includeTimeseries=true&includeCurrentMeasurement=true](http://www.pegelonline.wsv.de/webservices/rest-api/v2/stations/2730010.json?includeTimeseries=true&includeCurrentMeasurement=true)
   lädt und parametergesteuert JSON so ausgibt, in dem nur das drin ist was benötigt
   wird.
    z. B. so:
 *     ```
       <?php
       	$url = "http://www.pegelonline.wsv.de/webservices/rest-api/v2/stations/2730010.json?includeTimeseries=true&includeCurrentMeasurement=true";
       	$fc = file_get_contents($url);
       	$fcarr = json_decode($fc, TRUE);
       	$no = 0;
       	if (isset($_GET["no"])){
       		$no = filter_var ( $_GET["no"], FILTER_SANITIZE_NUMBER_INT);
       	}
       	$outarr = $fcarr["timeseries"][$no];
       	echo json_encode($outarr);
       ?>
       ```
   
 * Fragen zur PRO-VErsion werden hier leider nicht beantwortet. Hierfür bitte
    [https://jsoncontentimporter.freshdesk.com/widgets/feedback_widget/new?searchArea=no](https://jsoncontentimporter.freshdesk.com/widgets/feedback_widget/new?searchArea=no)
   nutzen.
 * Gruß
    Bernhard
 *  Thread Starter [major67](https://wordpress.org/support/users/major67/)
 * (@major67)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/problem-with-array-and-items/#post-16198086)
 * Ich hab’s per CSS gelöst, indem ich die ‘longname’-Ausgabe unsichtbar mache.
   
   Quick and dirty, aber für den Zweck reicht es.
 * `<span style=”visibility:hidden; font-size: 0px;”>{longname} </span>
 * Ich werde mir aber über kurz oder lang ein Plugin für meine Zwecke schustern 
   müssen.
 * Danke !
 *  Plugin Author [berkux](https://wordpress.org/support/users/berkux/)
 * (@berkux)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/problem-with-array-and-items/#post-16202213)
 * so gehts auch.
    wenn man es kann, ist ein maßgeschneidertes plugin natürlich 
   auch sehr gut.
 * Viel Erfolg,
    Bernhard

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Problem with array and items’ is closed to new replies.

 * ![](https://ps.w.org/json-content-importer/assets/icon-256x256.png?rev=3464653)
 * [Get Use APIs - JSON Content Importer](https://wordpress.org/plugins/json-content-importer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/json-content-importer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/json-content-importer/)
 * [Active Topics](https://wordpress.org/support/plugin/json-content-importer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/json-content-importer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/json-content-importer/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [berkux](https://wordpress.org/support/users/berkux/)
 * Last activity: [3 years, 7 months ago](https://wordpress.org/support/topic/problem-with-array-and-items/#post-16202213)
 * Status: resolved