Need an alternative to formula method

I’m currently developing a Coda Pack designed to offer real-time autocomplete for French postal addresses by utilizing the French Government Open API through a text-box query (${search}&autocomplete=1). Although I have managed to build the pack and implement the query successfully, it seems that the autocomplete feature is not functioning as expected. I suspect that creating a Coda formula might not be the most suitable approach for this pack, and I’m considering exploring alternative methods to address this issue. Would you think about another approach? Please

Doc with pack:

What’s the input for the formula? Does it take a street address and return a likely postal code match? Or does it take a partial postal code and return possible full postal codes?

Could you share the Pack with

Hey Nick,
Thanks for helping me. The input should start the address and automatically complete based on what the user types. I’ve added you to the document and package.

Thanks. I’ll dig in a bit further later, but right now I can’t think of a good way to implement this.

The native autocomplete feature in Packs is all about helping the user fill in formula parameters; it doesn’t work on regular input.

Packs don’t have a way to interact with input like this in real-time. The closest you could get is having an input column, a suggested address column, a button to accept the suggestion (clicking the button would then copy the suggestion into your main address column). The problem is, the suggestion column would only reach out to the Pack when the user is finished entering text (I.e. hit enter, click off somewhere outside the cell, etc). It wouldn’t work continuously.

Hmm, the only exception I can think of is a canvas column, in that edits are continuously written to the doc while editing is in progress (all other cell types are opened for editing, and then committed when done). Haven’t tested when formulas that depend on canvas cells recalculate, but it’s something to explore.

Ok yep! Formulas react to updates in Canvas columns on the fly as the user is typing. This works for both regular formulas and Pack formulas.

You have to deal with the UX drawbacks of a canvas column, for example that it can’t be edited inline in a table (but rather, pops open the detail view of the row as soon as you start to type). But if you have people already working in the detail view, you’d be ok (can open the row up with an Open Row button for example).

Not totally ideal, but it’s a way to get it working I think - would that setup work for your imagined use case?

(Also, let me know if the above info is enough to get you going on the implementation - I can explain more about formulas, column formats, etc if needed)


1 Like

This was possible pre-Aug 2022 with Itsy, a Pack that demonstrated how any web component could exist inside Coda and wherever a pack formula could be used.

Coda sealed off this capability for security reasons. I argued that they should have leaned into it and devised a sanitized sandbox to support this capability. I predict – eventually – the spirit of Itsy will rise from the dead not because I’m biased, but because Coda must embrace open web standards to help Makers address the millions of corner cases that exist.

1 Like

Unfortunately that is the case today. A feature request we’ve heard before is to enable auto-complete for column formats, and I think if that existed it would fit your needs well @Tommy_Lambert. In the mean time the solutions that Nick outlined are about the best you can achieve.

Hi Nick and Eric,
Thanks for your help. I will work on it. If you have any other ideas just let me know.