Help Accessing Data that is Nested

Hello, I am having trouble accessing specific data that I want to use in a table. I have connected my real time database from firebase but I am not understand how this query should be structured. The way my database is set up, I have a list of sensors with attributes and if there are multiple records for a sensor there are instances. These levels are:
{
"data": {
"testData": {
"sensors": {
"sensor_id_1": {
"instances": [
{
// sensor data attributes
},
// More instances if any
]
},
// More sensors if any
}
}
}
}

I am having trouble accessing the data for the sensors in the attributes. So far I can only access the names of the sensors by doing {{Object.keys(query2.data.TestData.sensors)[i]}} but it wont let me move down another level in the nested table to reach the specific information about the instances.
Capture

Hello and welcome to the forums!

Can you share some of the ways in which you've tried to access these nested properties?

Object.keys(..) is pulling out the key names but then you need to access each of the values associated with the keys -- query2.data.TestData.sensors['key'] -- to get the properties with something like query2.data.TestData.sensors['key'].instances[0]

There are ways to format the data to better suit specific cases, notably formatDataAsObject(data) and formatDataAsArray(data) where your TestData.sensors or after obtaining the keys TestData.sensors['key'] would be the desired object/array to format.

So I think i got it somewhat working but now I have another issue. The value of my containerTitle2 is: ### Instances - {{[i]}}. I have a Key Value table so I want to access {i} in my query but it is not being recognized. This is my code:
{{
query2.data.TestData.sensors[Object.keys(query2.data.TestData.sensors)[0]].instances[0]
}}

The goal is to replace instances[0] at the end with {i} but it is not being recognized. The value of containerTitle2 is a string but I need a int. I've seen people use containerTitle2.value() but that doesnt work. Is there a way I can just get {i} and use it in my query because all of my attempts have been unsuccessful. The point of doing this is that the values for each instance will change when {i} is a different value
Capture

I think I understand a little bit better where you are coming from.

You appear to be using a container to display data from an array and you are using the placeholder {{[i]}} in the title. If you want to trigger a query using a specific sensor instance you'll need to build that into whatever functionality you are designing that allows you to view and inspect your sensor data.

Where does the original query come into play? I assume you are either making an initial query for all data to view or that you have a component that allows a user to search/find a sensor to inspect.