How to Extract The Data I need from This Complex Array Structure?

[
{
“caption”: “”,
“headers”: [
“Country”,
“Super-Reduced Rate (%)”,
“Reduced Rate (%)”,
“Parking Rate (%)”,
“Standard Rate (%)”
],
“rows”: [
{
“index”: 1,
“columns”: [
“Austria (AT)”,
“-”,
“10 / 13”,
“13”,
“20”
]
},
{
“index”: 2,
“columns”: [
“Belgium (BE)”,
“-”,
“6 / 12”,
“12”,
“21”
]
},
{
“index”: 3,
“columns”: [
“Bulgaria (BG)”,
“-”,
“9”,
“-”,
“20”
]
},
{
“index”: 4,
“columns”: [
“Croatia (HR)”,
“-”,
“5 / 13”,
“-”,
“25”
]
},
{
“index”: 5,
“columns”: [
“Cyprus (CY)”,
“-”,
“5 / 9”,
“-”,
“19”
]
},
{
“index”: 6,
“columns”: [
“Czech Republic (CZ)”,
“-”,
“12”,
“-”,
“21”
]
},
{
“index”: 7,
“columns”: [
“Denmark (DK)”,
“-”,
“-”,
“-”,
“25”
]
},
{
“index”: 8,
“columns”: [
“Estonia (EE)”,
“-”,
“9 / 13”,
“-”,
“22”
]
},
{
“index”: 9,
“columns”: [
“Finland (FI)”,
“-”,
“10 /14”,
“-”,
“25.5”
]
},
{
“index”: 10,
“columns”: [
“France (FR)”,
“2.1”,
“5.5 / 10”,
“-”,
“20”
]
},
{
“index”: 11,
“columns”: [
“Georgia (GE)”,
“-”,
“-”,
“-”,
“18”
]
},
{
“index”: 12,
“columns”: [
“Germany (DE)”,
“-”,
“7”,
“-”,
“19”
]
},
{
“index”: 13,
“columns”: [
“Greece (GR)”,
“-”,
“6 / 13”,
“-”,
“24”
]
},
{
“index”: 14,
“columns”: [
“Hungary (HU)”,
“-”,
“5 / 18”,
“-”,
“27”
]
},
{
“index”: 15,
“columns”: [
“Iceland (IS)”,
“-”,
“11”,
“-”,
“24”
]
},
{
“index”: 16,
“columns”: [
“Ireland (IE)”,
“4.8”,
“9 / 13.5”,
“13.5”,
“23”
]
},
{
“index”: 17,
“columns”: [
“Italy (IT)”,
“4”,
“5 / 10”,
“-”,
“22”
]
},
{
“index”: 18,
“columns”: [
“Latvia (LV)”,
“-”,
“5 / 12”,
“-”,
“21”
]
},
{
“index”: 19,
“columns”: [
“Lithuania (LT)”,
“-”,
“5 / 9”,
“-”,
“21”
]
},
{
“index”: 20,
“columns”: [
“Luxembourg (LU)”,
“3”,
“8”,
“14”,
“17”
]
},
{
“index”: 21,
“columns”: [
“Malta (MT)”,
“-”,
“5 / 7”,
“12”,
“18”
]
},
{
“index”: 22,
“columns”: [
“Moldova (MD)”,
“-”,
“8 / 12”,
“-”,
“20”
]
},
{
“index”: 23,
“columns”: [
“Netherlands (NL)”,
“-”,
“9”,
“-”,
“21”
]
},
{
“index”: 24,
“columns”: [
“Norway (NO)”,
“-”,
“12 / 15”,
“-”,
“25”
]
},
{
“index”: 25,
“columns”: [
“Poland (PL)”,
“-”,
“5 / 8”,
“-”,
“23”
]
},
{
“index”: 26,
“columns”: [
“Portugal (PT)”,
“-”,
“6 / 13”,
“13”,
“23”
]
},
{
“index”: 27,
“columns”: [
“Romania (RO)”,
“-”,
“5 / 9”,
“-”,
“19”
]
},
{
“index”: 28,
“columns”: [
“Slovakia (SK)”,
“-”,
“5 / 19”,
“-”,
“23”
]
},
{
“index”: 29,
“columns”: [
“Slovenia (SI)”,
“-”,
“5 / 9.5”,
“-”,
“22”
]
},
{
“index”: 30,
“columns”: [
“Spain (ES)”,
“4”,
“10”,
“-”,
“21”
]
},
{
“index”: 31,
“columns”: [
“Sweden (SE)”,
“-”,
“6 / 12”,
“-”,
“25”
]
},
{
“index”: 32,
“columns”: [
“Switzerland (CH)”,
“”,
“2.6 / 3.8”,
“”,
“8.1”
]
},
{
“index”: 33,
“columns”: [
“Turkey (TR)”,
“1”,
“10”,
“-”,
“20”
]
},
{
“index”: 34,
“columns”: [
“Ukraine”,
“-”,
“7 / 14”,
“-”,
“20”
]
},
{
“index”: 35,
“columns”: [
“United Kingdom (GB)”,
“-”,
“5”,
“-”,
“20”
]
}
]
}
]

This is the structure. The data I need is given the country code, for example SE for Sweden, it should extract the standard VAT Rate, 25 in this case.

I don’t want to do it using iterators (I know how to do it like that), because it consumes a lot of operations. I was wondering if there’s any way to do it with map() or other array functions?

Hi,

If you’re planning to input a country code and retrieve the corresponding VAT value, you can use the switch function in Make.com for a straightforward solution.

Example:

switch({{Country_code}}; DE; 25; FR; 23; DK; 28; US; 30; null)

This function checks the input country code and returns the matching VAT value. If no match is found, it returns null

Right, the only issue is that I’m scraping the data and it comes in the format I provided regarding the VAT rates. So I need to extract it from there.

My country comes as an input just as two letters, for example SE.

I figured out how to do it map(rows; columns[4]; columns[1]; Country (CO))

The only issue is that I need to get the country in the right format, can’t just use the two letters.

So I’ll use switch to transpose the two letters I get into country names and then into the required format to place in map().