Grabbing data from an inconsistently structured array

I have an API returning the following structure that I am trying to output in a repeating group.

Stuck trying to reference the data points in the revenue array. It appears bubble is having trouble mapping the fields as some return empty arrays (shown in Town 1).

It shows the structure when I initialize the API call. However when I go to map the fields on the page, they don’t show up in the list of drop down items.

Is there a way I can text search for each item by group name?
I can’t quite figure out the expression for this one.

"item": [
        {
            "name": "Town 1",
            "id": 1,
            "revenue": []
        },
        {
            "name": "Town 2",
            "id": 2,
             "revenue": [
                {
                    "group": "GroupName1",
                     "dollars": 10000
                }, 
               {
                    "group": "GroupName2",
                     "dollars": 10000
                },

It would be something along the lines of Result of Step 1's items: first item's revenue's first item's group is GroupName1: formatted as text and then if it is a yes you would put Result of Step 1's items: first item's revenue's first item's dollars and for no you would move to the next like this, Result of Step 1's items: first item's revenue's first item's group is GroupName2: formatted as text. And you follow this process of nesting possibilities. And if at the very end it ends up being a number you need so it is red because you are formatting as text then just use the expression converted to a number.

1 Like

This makes sense though I am trying to display them in a repeating group. I don’t think I can pull them up with the Result of Step 1 part. My goal is to find a way to build an expression that grabs the data.

Current cells item . each items revenue . filtered (Constraint: This text contains GroupName1) : item 1

I put a . between points in the expression just to break up the line, that isn’t in the expression of course. This grabs the name but I can’t figure out how to reference the related fields in the array after that. I don’t think I am too far off from the solution here.

Can you make the repeating group data source the response from the api call?