how's it going? I have two tables (Table checkInError, Table checkInSinCerrar), which I extract the information from these from the following Object:
CheckIn= { "data": {
"checkInError": [
{
"date": {
"day": "2022/06/18",
"hour": "20:41"
},
"transactionCode": "AWSL6xCxVM",
"amount": 80,
"_id": 65165161
},
{
"date": {
"day": "2022/06/19",
"hour": "07:50"
},
"transactionCode": "VZz8xD6EJZQZ",
"amount": 80,
"_id": 65616465
},
{
"date": {
"day": "2022/08/22",
"hour": "16:25"
},
"transactionCode": "L3YASDSWZJE8A",
"amount": 100,
"_id": 465148659
}
],
"checkInSinCerrar": [
{
"date": {
"day": "2022/06/29",
"hour": "12:23"
},
"transactionCode": "VYAASDSOVPF7H",
"amount": 75,
"_id": 58796464
},
]
}} `
I would like to know how the values of the " checkInSinCerrar " and " checkInError " objects can be accessed correctly? I have tried with:
{[checkIn.checkInError].map((check) => (
<tr>
<td scope="row">{check?.transactionCode }</td>
</tr>
))}
also in this way:
const checkInSinCerrar = CheckIn.checkInSinCerrar
checkInSinCerrar.map((check) => (
<tr>
<td scope="row">{check?.day}</td> </tr>))
I have also tried with the Object.keys-values-entries
I would greatly appreciate help with this.
According to the structure you have, how are you assigning the object to CheckIn.
on this page if you need to see an object, it can help you later https://jsonformatter.curiousconcept.com/#
you're doing it right, only you have to pass through data first, depending on the structure of the object you have.
I would also recommend that you make validations of whether they are variables with value since the map can generate an error, here I leave you a simple one.
have a good evening