Parsing XML Post - Rows/Root - JSON Response as Table

Hi,
Iam trying to convert a XML Post by communcation System as XML → JSON Response to bring the result in a table to summary by “name”

this is my result in JSON: with full tree and subtrees.

{
  "methodResponse": {
    "params": {
      "param": {
        "value": {
          "struct": {
            "member": [
              {
                "name": "agentsLiveData",
                "value": {
                  "struct": {
                    "member": [
                      {
                        "name": "731",
                        "value": {
                          "struct": {
                            "member": [
                              {
                                "name": "AgentPhoneState",
                                "value": {
                                  "string": "RINGING"
                                }
                              },
                              {
                                "name": "AgentGroupState",
                                "value": {
                                  "string": "ACTIVE"
                                }
                              },
                              {
                                "name": "AgentId",
                                "value": {
                                  "string": "731"
                                }
                              },
                              {
                                "name": "AgentName",
                                "value": {
                                  "string": "Username1"
                                }
                              },
                              {
                                "name": "AgentUserState",
                                "value": {
                                  "string": "UNAVAILABLE"
                                }
                              }
                            ]
                          }
                        }
                      },
                      {
                        "name": "711",
                        "value": {
                          "struct": {
                            "member": [
                              {
                                "name": "AgentPhoneState",
                                "value": {
                                  "string": "AVAILABLE"
                                }
                              },
                              {
                                "name": "AgentGroupState",
                                "value": {
                                  "string": "ACTIVE"
                                }
                              },
                              {
                                "name": "AgentId",
                                "value": {
                                  "string": "711"
                                }
                              },
                              {
                                "name": "AgentName",
                                "value": {
                                  "string": "Username2"
                                }
                              },
                              {
                                "name": "AgentUserState",
                                "value": {
                                  "string": "AVAILABLE"
                                }
                              }
                            ]
                          }
                        }
                      },
                      {
                        "name": "726",
                        "value": {
                          "struct": {
                            "member": [
                              {
                                "name": "AgentPhoneState",
                                "value": {
                                  "string": "RINGING"
                                }
                              },
                              {
                                "name": "AgentGroupState",
                                "value": {
                                  "string": "ACTIVE"
                                }
                              },
                              {
                                "name": "AgentId",
                                "value": {
                                  "string": "726"
                                }
                              },
                              {
                                "name": "AgentName",
                                "value": {
                                  "string": "Username3"
                                }
                              },
                              {
                                "name": "AgentUserState",
                                "value": {
                                  "string": "UNAVAILABLE"
                                }
                              }
                            ]
                          }
                        }
                      },
                      {
                        "name": "728",
                        "value": {
                          "struct": {
                            "member": [
                              {
                                "name": "AgentPhoneState",
                                "value": {
                                  "string": "AVAILABLE"
                                }
                              },
                              {
                                "name": "AgentGroupState",
                                "value": {
                                  "string": "INACTIVE"
                                }
                              },
                              {
                                "name": "AgentId",
                                "value": {
                                  "string": "728"
                                }
                              },
                              {
                                "name": "AgentName",
                                "value": {
                                  "string": "Username4"
                                }
                              },
                              {
                                "name": "AgentUserState",
                                "value": {
                                  "string": "AVAILABLE"
                                }
                              }
                            ]
                          }
                        }
                      },
                      {
                        "name": "718",
                        "value": {
                          "struct": {
                            "member": [
                              {
                                "name": "AgentPhoneState",
                                "value": {
                                  "string": "RINGING"
                                }
                              },
                              {
                                "name": "AgentGroupState",
                                "value": {
                                  "string": "ACTIVE"
                                }
                              },
                              {
                                "name": "AgentId",
                                "value": {
                                  "string": "718"
                                }
                              },
                              {
                                "name": "AgentName",
                                "value": {
                                  "string": "Username5"
                                }
                              },
                              {
                                "name": "AgentUserState",
                                "value": {
                                  "string": "UNAVAILABLE"
                                }
                              }
                            ]
                          }
                        }
                      }
                    ]
                  }
                }
              },
              {
                "name": "callersLiveData",
                "value": {
                  "array": {
                    "data": {
                      "value": [
                        {
                          "struct": {
                            "member": [
                              {
                                "name": "CallerChannel",
                                "value": {
                                  "string": "SIP/1420101905-0000032d"
                                }
                              },
                              {
                                "name": "CallerState",
                                "value": {
                                  "string": "ringing"
                                }
                              },
                              {
                                "name": "CallerTime",
                                "value": {
                                  "string": "17123456789"
                                }
                              },
                              {
                                "name": "CallerPosition",
                                "value": {
                                  "int": "1"
                                }
                              },
                              {
                                "name": "CallerPriority",
                                "value": {
                                  "int": "0"
                                }
                              },
                              {
                                "name": "AgentId",
                                "value": {
                                  "string": ""
                                }
                              },
                              {
                                "name": "AgentName",
                                "value": {
                                  "string": ""
                                }
                              },
                              {
                                "name": "CallerName",
                                "value": {
                                  "string": "Hotline Group : 0001333444555666 Customer1)"
                                }
                              },
                              {
                                "name": "CallerId",
                                "value": {
                                  "string": "2f1f6cf1-41c2-4d71-8d94-ec8ebc164bd4"
                                }
                              },
                              {
                                "name": "CallerNumber",
                                "value": {
                                  "string": "15123456789"
                                }
                              }
                            ]
                          }
                        },
                        {
                          "struct": {
                            "member": [
                              {
                                "name": "CallerChannel",
                                "value": {
                                  "string": "SIP/1420101905-00000340"
                                }
                              },
                              {
                                "name": "CallerState",
                                "value": {
                                  "string": "waiting"
                                }
                              },
                              {
                                "name": "CallerTime",
                                "value": {
                                  "string": "17123456789"
                                }
                              },
                              {
                                "name": "CallerPosition",
                                "value": {
                                  "int": "2"
                                }
                              },
                              {
                                "name": "CallerPriority",
                                "value": {
                                  "int": "0"
                                }
                              },
                              {
                                "name": "AgentId",
                                "value": {
                                  "string": ""
                                }
                              },
                              {
                                "name": "AgentName",
                                "value": {
                                  "string": ""
                                }
                              },
                              {
                                "name": "CallerName",
                                "value": {
                                  "string": "Hotline Group : 0001333444555666 Customer2"
                                }
                              },
                              {
                                "name": "CallerId",
                                "value": {
                                  "string": "d24d3077-e217-4e5f-a873-e3579aa4b7d3"
                                }
                              },
                              {
                                "name": "CallerNumber",
                                "value": {
                                  "string": "00491523456789"
                                }
                              }
                            ]
                          }
                        }
                      ]
                    }
                  }
                }
              },
              {
                "name": "groupId",
                "value": {
                  "string": "98358"
                }
              }
            ]
          }
        }
      }
    }
  }
}

now I got follow result:

[
  {
    "name": "AgentPhoneState",
    "value": "RINGING"
  },
  {
    "name": "AgentGroupState",
    "value": "ACTIVE"
  },
  {
    "name": "AgentId",
    "value": "731"
  },
  {
    "name": "AgentName",
    "value": "Username1"
  },
  {
    "name": "AgentUserState",
    "value": "UNAVAILABLE"
  },
  {
    "name": "AgentPhoneState",
    "value": "AVAILABLE"
  },
  {
    "name": "AgentGroupState",
    "value": "ACTIVE"
  },
  {
    "name": "AgentId",
    "value": "711"
  },
  {
    "name": "AgentName",
    "value": "Username2"
  },
  {
    "name": "AgentUserState",
    "value": "AVAILABLE"
  },
  {
    "name": "AgentPhoneState",
    "value": "RINGING"
  },
  {
    "name": "AgentGroupState",
    "value": "ACTIVE"
  },
  {
    "name": "AgentId",
    "value": "726"
  },
  {
    "name": "AgentName",
    "value": "Username3"
  },
  {
    "name": "AgentUserState",
    "value": "UNAVAILABLE"
  },
  {
    "name": "AgentPhoneState",
    "value": "AVAILABLE"
  },
  {
    "name": "AgentGroupState",
    "value": "INACTIVE"
  },
  {
    "name": "AgentId",
    "value": "728"
  },
  {
    "name": "AgentName",
    "value": "Username4"
  },
  {
    "name": "AgentUserState",
    "value": "AVAILABLE"
  },
  {
    "name": "AgentPhoneState",
    "value": "RINGING"
  },
  {
    "name": "AgentGroupState",
    "value": "ACTIVE"
  },
  {
    "name": "AgentId",
    "value": "718"
  },
  {
    "name": "AgentName",
    "value": "Username5"
  },
  {
    "name": "AgentUserState",
    "value": "UNAVAILABLE"
  }
]

I want it like this as a table:

AgentId, AgentName, AgentPhoneState, AgentGroupState, AgentuserState, Extension in “agentsLiveData”

and in “callersLiveData”

CallerChannel, CallerState, CallerTime, CallerPosition, CallerPriority, AgentId, AgentName, CallerName, CallerId

my root and rows are filtered by this:

$.methodResponse.params.param.value.struct.member[name='agentsLiveData'].value.struct.member.value.struct.member.{ "name": name , "value": value.string }

how is it possible now to filter this in a table for example:

agentId:
718
728
.
.
.

here I tried some things but I come not to the final result as I need.

https://try.jsonata.org/GrN36_iDk

Hi @shasamkab,

This is the community forum of JSON Forms, a rendering engine for JSON Schema based forms. Your question seems to be unrelated. I would like to suggest to contact the person you got your task from. Good luck!