New-UDGrid and nested values

I am running an API query in my New-UDGrid

            New-UDColumn -Size 6 -Content {
                New-UDGrid -Title "vMon services" -FontColor "#cbd9ef" -BackgroundColor "#303235" -Headers @("key","startup_type","state","health") -Properties @("value.name_key","value.startup_type","value.state","value.health") -AutoRefresh -RefreshInterval 60 -Endpoint {
                    (Invoke-RestMethod -headers $session -method GET -uri "https://cd-lab-vc1.cragdoo.co.uk/rest/vmon/service").value | Out-UDGridData
                }
            }
            
        }

with the output being

    "value": [
        {
            "value": {
                "name_key": "cis.analytics.ServiceName",
                "startup_type": "AUTOMATIC",
                "health_messages": [],
                "health": "HEALTHY",
                "description_key": "cis.analytics.ServiceDescription",
                "state": "STARTED"
            },
            "key": "analytics"
        },

how would I go about extracting just the “key” and “health” values? If run the above I get a “404 not found” error on the grid

fixed it

wrong URI being specified

1 Like