I have the following JSON response:
{ "d": { "results": [ { "__metadata": { "id": "c55209ae-2af9-4514-ab02-67f222903f6d", "uri": "https://site-GUID.sharepoint.com/sites/dev/MyApp/_api/Web/Lists(guid'46f26a73-0079-4662-ae99-7f4be03e26a4')/Items(1)", "etag": "\"1\"", "type": "SP.Data.LstDoelenListItem" }, "scDoelnaam": "Hoofddoel Afdeling", "scDoellevel": 1 }, { "__metadata": { "id": "7e79ab8a-e550-4694-87d4-26d6f5bc6128", "uri": "https://site-GUID.sharepoint.com/sites/dev/MyApp/_api/Web/Lists(guid'46f26a73-0079-4662-ae99-7f4be03e26a4')/Items(2)", "etag": "\"1\"", "type": "SP.Data.LstDoelenListItem" }, "scDoelnaam": "Subdoel 1", "scDoellevel": 2 }, { "__metadata": { "id": "c204acca-0362-4bd6-a66b-00236a2320cb", "uri": "https://site-GUID.sharepoint.com/sites/dev/MyApp/_api/Web/Lists(guid'46f26a73-0079-4662-ae99-7f4be03e26a4')/Items(3)", "etag": "\"1\"", "type": "SP.Data.LstDoelenListItem" }, "scDoelnaam": "Subdoel 2", "scDoellevel": 2 }, { "__metadata": { "id": "b78b2416-7813-4e64-a920-f9ba377fa36d", "uri": "https://site-GUID.sharepoint.com/sites/dev/MyApp/_api/Web/Lists(guid'46f26a73-0079-4662-ae99-7f4be03e26a4')/Items(4)", "etag": "\"1\"", "type": "SP.Data.LstDoelenListItem" }, "scDoelnaam": "Subdoel 3", "scDoellevel": 2 } ] } }
I know how to retrieve the values once I know the column names, but how do I get the 2 column names "scDoelnaam" and "scDoellevel" with Javascript and assign them to variables??