• Resolved gafco

    (@gafco)


    Hi,
    Im trying to get to the “third level” for data but am having trouble. Im trying to get the weatherDesc value

    {
        "data": {
            "request": [
                {
                    "type": "LatLon",
                    "query": "Lat 36.69 and Lon -75.92"
                }
            ],
            "current_condition": [
                {
                    "observation_time": "12:37 AM",
                    "temp_C": "27",
                    "temp_F": "80",
                    "weatherCode": "116",
    
                    "weatherDesc": [
                        {
                            "value": "Partly cloudy"
                        }
                    ],
                    "windspeedMiles": "4",
                    "windspeedKmph": "6",

    }
    ]

    I have tried:
    {subloop:data:-1}
    {subloop:current_condition:-1} <p>Condition: {weatherDesc.value}{/subloop:current_condition}
    {/subloop:data:-1}

    and
    {subloop:weatherDesc:-1} <p>1Condition: {weatherDesc.value}{/subloop:weatherDesc}

    with the Basenode set to data.current_condition

    Thanks
    Greg

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter gafco

    (@gafco)

    I also tried this:
    {subloop:current_condition:-1}
    {subloop:current_condition.weatherDesc:-1} <p>Condition: {current_condition.weatherDesc.value}{/subloop:current_condition.weatherDesc}
    {/subloop:current_condition}

    no luck

    Plugin Author berkux

    (@berkux)

    Hi,

    try this:

    [jsoncontentimporter url=https://api.json-content-importer.com/extra/json/gafco1.json basenode=data.current_condition]
    observation_time: {observation_time}<br>
    {subloop-array:weatherDesc:-1}
    {weatherDesc.value}<br>
    {/subloop-array:weatherDesc}
    [/jsoncontentimporter]

    Bernhard

    Thread Starter gafco

    (@gafco)

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘JSON Data’ is closed to new replies.