How to filter in multidimensional array? : I am working on a filter menu. I have an array something like below. From my filter menu I will get an array result:

    {gm: "FS H", rm: "RSM1", am: "BKK PULL", sales: "BKK SR1", state: "delhi", …}

From this result I need to find the associated sa_id and pr_id.
From above result: gm is top menu. rm is filtered based on gm selected. 

Given is my whole array. Now I dont know how to filter to get my id. 

    {
    "FS H": {
        "RSM1": {
            "BKK PULL": {
                "BKK SR1": {
                    mumbai: {
                        sa_id: 34,
                        pr_id: 12
                    },
                    delhi: {
                        sa_id: 12,
                        pr_id: 32
                    }
                }
            },
            "BKK PUSH": {
                "BKK BCDE1": [],
                "BKK BAKE SE1": []
            }
        },
    }

