T
Twenty4mo ago
Rob

REST API: How to get multi select data

HI Twenty team! When using the REST API, I can sucesfully use find many companies to get information about companies. It contains many useful details. But, it does not return information about multi select fields. Is this intentional missing and there is another way for me to retrive this information? Or is it an upcoming feature or bug? Appreciate the great product and your help, Rob
10 Replies
Rob
Rob4mo ago
Simillarly, is it possible to filter by multi select when using find many companies? I can't seem to get it to work. Any pointers would be appreciated. E.g.
import requests

url = "https://{redacted}/rest/companies"

querystring = {"filter":"multiSelectField[eq]:OPTION_IN_CAPS","limit":"1","depth":"2"}

headers = {
"Accept": "application/json",
"Authorization": "Bearer {redacted}"
}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
import requests

url = "https://{redacted}/rest/companies"

querystring = {"filter":"multiSelectField[eq]:OPTION_IN_CAPS","limit":"1","depth":"2"}

headers = {
"Accept": "application/json",
"Authorization": "Bearer {redacted}"
}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
Rob
Rob4mo ago
I think this is the same issue as https://github.com/twentyhq/twenty/issues/5358 Sorry for the duplicate, I forgot front and backend are linked 😉
GitHub
Multi Select cannot filter · Issue #5358 · twentyhq/twenty
I create MultiSelect, but cannot filter it.
charles
charles4mo ago
Hi @Rob, sorry for the late answer. @martmull could you check the REST api tomorrow regarding the ability to return multi select in the response? Regarding the ability to filter by multi-select, this is currently a known limitation of an underlying postgres extension (pg_graphql) we are using. We are planning to get rid of pg_graphql before the end of the year but it's a long term effort
martmull
martmull4mo ago
@charles @Rob here is the fix for missing multi-select in rest api responses. Added a test to not forget to update rest api when adding new fieldMetadataType https://github.com/twentyhq/twenty/pull/6253
Rob
Rob4mo ago
That’s amazing! Thanks so much
lucas lima
lucas lima4mo ago
hey guys! @martmull server url would be just for api use in the future? and front base the actual front end user?
martmull
martmull4mo ago
@lucas lima sorry I don't fully understand your question, you are talking about environment variables SERVER_URL and FRONT_BASE_URL isn't it? If yes, SERVER_URL is used by the twenty-front package also FRONT_BASE_URL is used by the twenty-server package mostly to compute redirect urls
lucas lima
lucas lima4mo ago
@martmull yes! I was thinking that would be one of then for api use and the another one to access the twenty! I'm using the same address for the both Would be great if the kan ban screen update realtime or something like this, or every 5min or some enviroment option
martmull
martmull4mo ago
yes, we planned to investigate websocket real time updates
charles
charles4mo ago
Likely later this year 🙂
Want results from more Discord servers?
Add your server