T
Twentyβ€’3w ago
Rytterboi

Autocomplete cell editor based on API

Hi!, I am wondering whehter twenty.com can work for my use case. Everything out of the box is nice and a very good starting point, however it needs some extensions to cover what we need. One thing i need is a way to get results for the auto complete cell editor to show data from an API, rather than related records from another table. What i think is the relation picker OOTB. I would also need to make a request with the selected value to another API, get the data back and populate the full record using the returned data. This does not seem to be a major extension, however i am struggling as to where in twenty.com repo i would need to look to extend it with effectively another type of cell/different cell editor. That can do this. Any pointers as to where to look would be highly appreciated. Thanks a lot! πŸ™‚
7 Replies
Prastoin
Prastoinβ€’3w ago
Hello there,
One thing i need is a way to get results for the auto complete cell editor to show data from an API, rather than related records from another table. What i think is the relation picker OOTB.
Mhm that's a good point, what you could do is setup a workflow that will edit a field metadata select/multi select defining its options dynamically either using a cron or custom webhook I'm not sure if we will create such complexity natively in an dynamic select/multi field type In my opinion the best twenty extension would be using what twenty has in its toolbox rather than forking and building your own custom image By that I mean you can play with custom trigger, custom serverless and workflow hitting twenty api directly in order to configure your data model and so on
Rytterboi
RytterboiOPβ€’3w ago
Thats a good point. I would love to use what is already built in. If i never have to touch the underlying javascript code that would be a huge win. I am a dev so i can do it. But since i dont know the code base i think the most likely outcome would be unmaintainable spaghetti code. The main issue is that the select would need to update in realtime. And from what i can gather you would need a full page refresh to repopulate the select options. Which defeats the purpose a bit. An alternative option would just be to make some simple side car ui to get and dump a bunch of the finished strings we need to excel, Then import them into the twenty table. That way i dont have to mess with the twenty codebase, though it would not be as clean or refined a workflow. Would be awesome if twenty supported such a thing. But sometimes you arent gonna get exactly what you want i suppose πŸ™‚ Will play around with it a bit and see what is possible Probably should add that the reason i cannot just prepopulate the select field is because there are a ton of options. We need autoselect based on national address register. So i think dumping and setting up a cron for that would be quite exensive? We would be talking millions of addresses here :/ Else the idea would be a solid solution
Prastoin
Prastoinβ€’3w ago
If i never have to touch the underlying javascript code that would be a huge win
Agreed that's why I recommend building code through the twenty app such as serverless function x workflows rather than forking the repo
And from what i can gather you would need a full page refresh to repopulate the select options
That's interesting you're right you would get a metadata version missmatch πŸ€” We're also about to provide custom layout to twenty allowing the render custom component iframes and their logic into twenty I can't think of a setup that would fit your exact need in here even with the upcoming feature because it would always end to updating the metadata and requiring a refresh
So i think dumping and setting up a cron for that would be quite exensive?
Depends on the logic you're executing I would say
Rytterboi
RytterboiOPβ€’3w ago
Yeah it might just be too tall of an ask. It would be really cool if it was/becomes possible at some point without a lot of hacking around πŸ˜„ Only solution i can think of would be to add a custom celleditor that is the thing. And then its just code which would be easy to make. Though i have no clue where to add that to the repo. What we need/want is just a way to get auto complete results from an api and show them while typing in the address. We need the exact address as it shows in the register. We already have the api that delivers the autocomplete. But no way to add that to twenty. Which would be ideal. Sidecar UI seems the most sensible solution i can think of here
Prastoin
Prastoinβ€’3w ago
We're about to relase a v1 of custom layout by the end of Q3 especially for incmoing dashboard views But yeah for sure at some we will allow custom cell editor widgets, I don't have an ETA right now though for this specifically
What we need/want is just a way to get auto complete results from an api and show them while typing in the address.
Indeed pretty basic stuff @RaphaΓ«l does this ring a bell to you ?
Rytterboi
RytterboiOPβ€’3w ago
Yep its always a pain though a lot of table libraries dont support this stuff out of the box. I dont know why its not more prominent. I often need it and have often had to built it myself. Or do some wonky override on something to get it done πŸ™‚ And hey thanks for taking the time πŸ™‚
Prastoin
Prastoinβ€’3w ago
All good no worries

Did you find this page helpful?