title: Convert nested object to array of object
body: <p>I would like to convert my below object to a specific format see..</p>
  
  <p>my Object is look like </p>
  
  <pre><code>{
    "RecruiterInfo": {
      "Person": {
        "FirstName": "vals ererererre123",
        "LastName": "ravl2422",
        "CreatedOn": "1900-01-01T00:00:00",
        "Worktelephone": "",
        "PhoneNo": "9586391750",
        "Email": "vil@mailinator.comm",
        "UserId": {
          "Password": "Vm0wd2QyUXlWa1pOVldScFVtMVNjRlZ0TVZOWFJsbDNXa2M1VjJKSGVEQmFWVll3VjBaS2RHVkljRmRXTTJoeVZtMHhTMUl5VGtsaVJtUlhUVEZLVFZac1ZtRldNVnBXVFZWV2FHVnFRVGs9",
          "Status": 1,
          "ID": 1
        },
        "ID": 31
      },
      "CompanyName": "Teenr1242424",
      "Designation": "PM125554242",
      "BusinessType": 1179,
      "OrganizationSize": 1119,
      "IsVIP": 1
    }
  }
  </code></pre>
  
  <p>I would like to convert above object to </p>
  
  <pre><code>[
    {
      AppFieldID: "CompanyName",
      Value: "Teenr1242424"
    },
    {
      AppFieldID: "Designation",
      Value: "PM125554242"
    },
    {
      AppFieldID: "BusinessType",
      Value: 1179
    },
    {
      AppFieldID: "OrganizationSize",
      Value: 1179
    },
    {
      AppFieldID: "IsVIP",
      Value: 1
    },
    {
      AppFieldID: "Person",
      Value: [
        {
          AppFieldID: "FirstName",
          Value: "vals ererererre123"
        },
        {
          AppFieldID: "ID",
          Value: 1
        },
        {
          AppFieldID: "CreatedOn",
          Value: "1900-01-01T00:00:00"
        },
        {
          AppFieldID: "Email",
          Value: "vil@mailinator.comm"
        },
        {
          AppFieldID: "LastName",
          Value: "ravl2422"
        },
        {
          AppFieldID: "WorkTelephone",
          Value: ""
        },
        {
          AppFieldID: "PhoneNo",
          Value: "9586391750"
        },
        {
          AppFieldID: "UserId",
          Value: [
            {
              AppFieldID: "ID",
              Value: 1
            },
            {
              AppFieldID: "Password",
              Value: "Vm0wd2QyUXlWa1pOVldScFVtMVNjRlZ0TVZOWFJsbDNXa2M1VjJKSGVEQmFWVll3VjBaS2RHVkljRmRXTTJoeVZtMHhTMUl5VGtsaVJtUlhUVEZLVFZac1ZtRldNVnBXVFZWV2FHVnFRVGs9"
            },
            {
              AppFieldID: "Status",
              Value: 1
            }
          ]
        }
      ]
    }
  ]
  </code></pre>
  
  <p>it should be a dynamic code, because in feature there will be multiple nested object</p>
  
  <p>can anyone help for convert that object to above array</p>
  
  <p>I tried to convert it by using some nested loop and making recursive function, but i am not able to convert.</p>
  
  <p>thanks
  kj</p>