Struggling with Mapping - Multiple Arrays, multiple collections!

Hi all! Newbie here (and losing my mind!)…

Please see screenshot, this is the output data from getting a bank summary from Xero which shows the headers in one array, 1 bank account and the values in an array called “section” and then the other 3 accounts in an array in “sections”.

All I need from this is the “Closing Balance” value (the fifth value in each collection) from each bank account which I then want to run though a filter (e.g. if closing balance less than 1000) and send a notification.

I’ve tried many things but I can’t seem to actually get this data! Can anyone help me please?

Many thanks!

1 Like

Hi @emma, Can you share the downloaded json output from this ? make sure to text edit the blurred values. Is the structure always repeated in this order ? The solution would be to select

Section [ ] : Value, but put 5 inside the brackets like this : Section [ 5 ] : Value
And :
Sections [ 5 ] : Value etc.

Mention me if you have questions.

Hi @kudracha , thanks for helping me! This is the output and it appears to always be this order:

[
{
“header”: [
{
“value”: “Bank Accounts”
},
{
“value”: “Opening Balance”
},
{
“value”: “Cash Received”
},
{
“value”: “Cash Spent”
},
{
“value”: “Closing Balance”
}
],
“section”: [
{
“value”: “MHB Current Account”,
“id”: “XXXX”
},
{
“value”: “XXXX”
},
{
“value”: “XXXX”,
“id”: “XXXX”
},
{
“value”: “XXXXX”,
“id”: “XXXX”
},
{
“value”: “XXXX”
}
],
“sections”: [
[
{
“value”: "MHB Business Premium “,
“id”: “XXXX”
},
{
“value”: “XXXX”
},
{
“value”: “XXXX”,
“id”: “XXXX”
},
{
“value”: “XXXX”,
“id”: “XXXXX”
},
{
“value”: “XXXX”
}
],
[
{
“value”: “MHB Client Premium”,
“id”: “XXXXXX”
},
{
“value”: “XXXXX”
},
{
“value”: “XXXX”,
“id”: “XXXX”
},
{
“value”: “XXXX”,
“id”: “XXXXX”
},
{
“value”: “XXXX”
}
],
[
{
“value”: “MHB Current Account”,
“id”: “XXXXX”
},
{
“value”: “XXXX”
},
{
“value”: “XXXXX”,
“id”: “XXXXX”
},
{
“value”: “XXXXX”,
“id”: “XXXXX”
},
{
“value”: “XXXXX”
}
]
],
“summary”: [
{
“value”: “Total”
},
{
“value”: “XXXXX”
},
{
“value”: “XXXXX”
},
{
“value”: “XXXXX”
},
{
“value”: “XXXXX”
}
],
IMTLENGTH”: 1,
IMTINDEX”: 1
}
]

I’ve managed to get the value 5 out of section but when I do it for sections (in a different iterator) the array is empty. I need them for all accounts (and there are 3 in “sections”) in one place so I can put them all through a filter. Thanks again

@emma, Here you go. Just import the blueprint in a new scenario and test it out. Your scenario needs an iterator through sections. aggregator is there so we can import sections 1 2 3 in one step - see ‘set variables’ module.

get bank accounts.json (9.8 KB)

@kudracha Thank you so much for this, I’m starting to understand it more now and I can confirm I have all the values I need! Really appreciate your help on this - saved me hours! :grinning: