Function Node programming - get key name of object property


i have a problem with programming. When i have an array like this:


i had converted this with json parse to the string.

how can i get the name of "fff" when i dont know the name "fff". i need the secound !

can you help me ?

Hi, welcome to the forum

Firstly, the JSON you posted is invalid JSON (you have ; semicolons instead of ':' colons).

Secondly, the JSON you have posted would be an OBJECT not and ARRAY (arrays are defined by [] square brackets)

Assuming for a second you meant to post ...

    "aaa": {
        "bbb": "ccc",
        "ddd": "eee"
    "fff": {
        "ggg": "hhh",
        "iii": "jjjj"

Are you asking how to get the key name fff as a string - OR - the value of fff (e.g. {"ggg":"hhh", "iii";"jjjj"} )

okay, then we talk about an object. i need the key "fff" but i dont know that it is "fff". i need a syntax where i can get the secound or the fifth or something else key.

i will make a loop where i get back all the keys in this object, you know ?

A function node with Object.keys(myObj) will do it...


perfect !!! many many thanks. thats what i needed !!

Just for info you can not guarantee the order of an object (dictionary), so be careful. It may be fine, depending on what and how the object is created.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.