Summary
User is seeking assistance with a custom connector for an API, specifically on how to extract values from a nested array in the response and transform them into a single column for further API calls.
Question
Hi everyone! I need a bit of help with a custom connector I’m trying to setup for an API. I get the response in the following format:
"routes": [
{
"code": "000002",
"name": "TestRoute",
"meter.serials": [
"18ML914414",
"19BF087224",
"19BA490899",
"19BF086977",
"20ML938543",
"19BA490900",
"19BI088224",
"19BA490901"]
}]}```
I would need to get a single column just with the _<http://meter.se|meter.se>_rials values. As I need to use this as a parent for another API call. I’m trying to use the record selector in the custom connector builder, but I can’t figure out how to do this.
If I use only _routes, I get the 3_ columns _code, name, <http://meter.se|meter.se>_rials, but the meter.serials is still an array. If I try to use as record selector _routes, * ,meter.serials_ I get an: *list indices must be integers or slices, not str* which I guess it’s actually normal.
I also tried using “Transformations”, but after removid the two other columns, I can’t figure out how to break down the array into multiple rows.
Did anyone faced a similar issue and found a solution? Thank you!
<br>
---
This topic has been created from a Slack thread to give it more visibility.
It will be on Read-Only mode here. [Click here](https://airbytehq.slack.com/archives/C021JANJ6TY/p1709890001413909) if you want
to access the original thread.
[Join the conversation on Slack](https://slack.airbyte.com)
<sub>
['custom-connector', 'api-response', 'record-selector', 'transformations', 'meter-serials']
</sub>