[Bug]: Airtable - "fields" query param is not being passed to API properly, does not filter fields returned
Is there an existing issue for this?
- [X] I have searched the existing issues
Description
In the Airtable query settings, the Fields input should accept an array of strings, and pass that to the API to filter the fields that are returned. However, the input either causes an error (when passing an array of strings) or is ignored (when passing a string).
The error when passing an array shows the resulting request URL:
Illegal character in query at index 65:
https://api.airtable.com/v0/BASE_ID/TABLE_ID?["test"]&filterByFormula=&maxRecords=&pageSize=&&view=&cellFormat=&timeZone=&userLocale=&offset=0
This shows that the fields param is being passed without a key, and the array is not being url encoded. Adding the fields= before the param value, and url encoding the value should fix this issue.
Steps To Reproduce
- create an API key from your Airtable account
- create an Airtable datasource in Appsmith
- add a
List recordsquery and test that it is working - try adding an array or string of field name(s) to the
Fieldsinput - observe that the fields are not filtered when using a string, and that the API fails when using an array.
Public Sample App
No response
Environment
Production
Issue video log
No response
Version
Appsmith v1.9.12-SNAPSHOT
cc @spark-c
It seems like there might be a similar problem with the sort parameter; I hadn't tested it much at the time, but right now my results are coming back in the same order regardless of sort. Example:
// Sort field = employee_id
{
"records": [
{
"id": "recdo8NkX4ucvnXIy",
"createdTime": "2023-03-14T14:10:46.000Z",
"fields": {
"name": "Ashley Hatter",
"date_of_birth": "1993-06-05",
"employee_id": 1005 // out of order
}
},
{
"id": "rectV0sV07e04PfTR",
"createdTime": "2023-03-13T15:11:26.000Z",
"fields": {
"name": "Sarah Carne",
"Done": true,
"employee_id": 1003,
"date_of_birth": "1989-04-05"
}
}
]
}
Another user on Discord is facing this issue. https://discord.com/channels/725602949748752515/778949891014656050/threads/1113278316556853338
@rohan-arthur could I get an update on a fix for this please?