Google Charts Trouble Formatting Data

Hello,
I’ve been trying to format some data to display in Google Charts, the data is returned from my rest API as an object with items ‘data’ and ‘rank’.

In the formula editor:
[[‘Date’, ‘Rank’],MAP(data.MyPropStatus, [item.rank_for_property[index][“date”], item.rank_for_property[index][“rank”]])]

Displays the example results as:
Screen Shot 2020-06-28 at 9.24.10 AM

This is what my API returns:

[
    {
        "id": 10,
        "room_id": "20320837",
        "rating": "4.54",
        "reviews": "41",
        "price": "101",
        "label": "My place",
        "rank_for_property": [
            {
                "date": "2020-06-24",
                "rank": 8
            },
            {
                "date": "2020-06-20",
                "rank": 74
            }
        ]
    }
]

How do I transform the data from ‘rank_for_property’ into a proper array to be consumed by the Google Chart? The sample output shows that the items are incompatible, it looks like it is expecting something more like:
[[“Date”, “Rank”], [“2020-06-24”,15],[“2020-06-13”, 38]]
So seems like there is an extra set of square brackets turning it into an object instead of array. I can’t call the MAP function and use both date and rank though without using the brackets. What am I missing here?

Thank you!

I think CONCAT should work here.

Try something like CONCAT([[‘Date’, ‘Rank’]],MAP(data.MyPropStatus, [item.rank_for_property[index][“date”], item.rank_for_property[index][“rank”]])). Note that there’s two square brackets around [[‘Date’, ‘Rank’]] to make sure those stay as their own individual array even after CONCAT.

Thanks for the response. I get a valid array back with concat like this
[[‘Date’, ‘Rank’],CONCAT(MAP(data.Rank, item.date), MAP(data.Rank, item.rank))]

But sadly, Google Charts is empty. Guess I will start debugging that.