• Resolved jesd00

    (@jesd00)


    Hello – I’ve spent the day trying to parse the “estimate” element from this json, without success. Any hints?

    This is the latest variation I have tried:

    [jsoncontentimporter url="https://data.census.gov/api/profile/content/topic?g=0500000US27053&infoSection=Age%20and%20Sex"  basenode="measureData"] 
    
    {subloop-array:stats:-1}
    {subloop-array:stats.0:-1}
    
    {stats.0.estimate}<br>
    
    {/subloop-array:stats.0}
    {/subloop-array:stats} 
    
    [/jsoncontentimporter]

    This is the source json I am trying to parse:

    {
        "selectedProfile": {
            "label": "Hennepin County, Minnesota",
            "params": {
                "g": "0500000US27053"
            }
        },
        "topic": "Age and Sex",
        "measureData": {
            "title": "Age and Sex",
            "source": "<a href='https://www.census.gov/programs-surveys/acs.html'>2021 American Community Survey 1-Year Estimates</a>",
            "table": {
                "tableID": "ACSST1Y2021.S0101",
                "link": true
            },
            "stats": [
                [
                    {
                        "format": "",
                        "estimate": "37.4",
                        "moe": "0.2",
                        "description": "Median Age in Hennepin County, Minnesota"
                    }
                ],
                [
                    {
                        "format": "",
                        "estimate": "38.8",
                        "moe": "0.1",
                        "description": "Median Age in Minnesota"
                    }
                ]
            ]
        },
        "vizData": {
            "title": "Population by Age Range in Hennepin County, Minnesota",
            "type": "chart",
            "format": "percent",
            "source": "2020 ACS 5-Year Estimates Data Profiles",
            "table": {
                "tableID": "ACSDP5Y2020.DP05",
                "link": true
            },
            "chartType": "bar",
            "stats": [
                {
                    "description": "Under 5 years",
                    "value": "6.4",
                    "moe": "0.1"
                },
                {
                    "description": "Under 18 years",
                    "value": "22.0",
                    "moe": "*****"
                },
                {
                    "description": "18 years and over",
                    "value": "78.0",
                    "moe": "*****"
                },
                {
                    "description": "65 years and over",
                    "value": "14.1",
                    "moe": "0.1"
                }
            ]
        }
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author berkux

    (@berkux)

    Hello,

    the “[ [” at stats is a problem. Sorry to say, that this JSON-part can’t be handled by the free JCI-Plugin. A single “[” is no problem…

    Bernhard

    Thread Starter jesd00

    (@jesd00)

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Help with an array, please’ is closed to new replies.