i got an json file with monthly values. i need to access these. I am not able to archive this. Maybe i just make an mistake.
{"sales":
{
"total_sales":"999.99",
"totals":
{
"2020-10-01":
{
"sales":"9.99",
}
}
}
}
How can i get the value from the second "sales" with 9.99?
I use JS to get the total_sales. This works.
I really need you help for this.
For more clearence: The JSON-File is an original from Woocommerce.
I implement the Json with the original API and need the sales for every month.
I already tried it with Object.keys but it does not work. i only get the (2020-01-01) Names but not the nested values.
Here is the information about the original JSON File: https://github.com/woocommerce/woocommerce-rest-api-docs/blob/master/source/includes/v2/_reports.md
Bad thing is the date string as key.
Maybe there is a tricky way to archive the result.