Issue with API Connector lists

I have a critical issue with API Connector.

It cannot handle arrays in proper way. If I have a mapped list the solution works as long as there is more than 1 row. But if API returns only 1 row the API Connector is not behaving like it should for an array. This results that workflows for lists don’t work.

Certainly somebody has had pain with this too. How you have handled these cases?

Please help me soon as I am stucked because of this. I really don’t want to make duplicated calls (one for lists with more than 1 row and one for list with just one row)

Best regards,
Jaakko

Issue seem more to be related on how API service respond than API Connector issue. Can you lonk the api doc or givr example with one that return one result anf another with the array

Thanks for your reply. I don’t think that this is problem from service side.

Here is the response with 1 row from API service but API Connector is not handle this as a list. Why?

{
“Root”: {
“ResponseStatus”: {
“Status”: “OK”,
“TimeStamp”: “21.1.2020 12:07:50”
},
“PurchaseOrderList”: {
“PurchaseOrder”: {
“OrderNumber”: “1”,
“OrderDate”: {
“_”: “2020-01-21”
},
“OrderStatus”: “proposal”,
“VendorName”: “Testitoimittaja”,
“Amount”: “0”
}
}
}
}

Because its not a list. Can you provide screenshot of more than 1 item to compare?

1 Like

{
“Root”: {
“ResponseStatus”: {
“Status”: “OK”,
“TimeStamp”: “21.1.2020 14:44:25”
},
“PurchaseOrderList”: {
“PurchaseOrder”: [
{
“OrderNumber”: “2”,
“OrderDate”: {
": “2020-01-21”
},
“OrderStatus”: “proposal”,
“VendorName”: “Testitoimittaja”,
“Amount”: “0”
},
{
“OrderNumber”: “3”,
“OrderDate”: {
"
”: “2020-01-21”
},
“OrderStatus”: “proposal”,
“VendorName”: “Testitoimittaja”,
“Amount”: “0”
}
]
}
}
}

Look at the diffence. Purchase order in the second screenshot start with [ and end with ] that is an array, This is not the case with the first payload. So the issue is that the API Service provider that doesn’T return the same response everytime. You can ask them to fix that but maybe in Bubble you can fix that by setting a response manually with both case.

1 Like

Ah ok. You’re right, there is a difference. Thanks very much for your time. I have to figure out some kind of working solution for this as API Service provider certainly can’t change it because of the Bubble.

I will say that it’s not because of Bubble. They should change it because it’s not a good practice to have different payload like that.

But you can work with that situation I’m pretty sure by creating your own manual response or maybe a plugin.

2 Likes