Language sensitive items in Coda forms.
How to show users the items in the language of their choice?
I have one table that generates multiple forms. Each form is language specific, I have a French form, a Dutch form and an English form. In each form there are some drop downs and I only want to offer the items in the language of the form. How to do that?
There is not an elegant solution for this problem. With elegant I mean that the form knows which language it has to show. ideally, the French form should use French items and the English form items in English.
The reason this won’t work is that form is not self aware. I did not realise this first and I assumed that when I would write: thisTable.ObjectLink()
it would give me the object link of the form I was in and that I could use in a filter. That appears not to be the case. The ‘thisTable’ references the table you create that has the form as a display option. It does not reference the view of the table you are actually in.
When the form is unaware of its table view we need to tell the table explicitly which language to reference when you have a drop down menu.
In the above screenshot we offer everything in French, but I still ask if this is the preferred language. This feels a kind of stupid, but it is the only way to show only French items. Below how it goes in English.
How to make the drop down intelligent?
It all starts with applying the typical list logic in Coda. We define the items we want to show and link them to their language. Below how that goes.
The second step is to put a filter in the form using the options part. The language is a drop down menu based on a table DB Languages. The tripDuration is a also a dropdown menu, but filtered on the selected language.
Here you go. You can have many language sensitive fields in your form once you ask for the preferred language since the form itself is unaware. The currentvalue is the dropdown item living in the display column and we chain it to the language we added in the table you see above: DB Trip Duration.
I use the selected language to write the confirm message in the language of choice and also the AI that is linked to this form, is instructed to apply an outcome in this language.
This little field serves many purposes at once. Without it, the form shows all items.
Some people believe they need per language a column and will per form show the related column. That is a viable option as long as you have few fields and few languages. This is not my cup of tea.
My name is Christiaan and blog about Coda. Since the summer of 2023 mainly about how to Coda with AI to support organisations dealing with texts and templates. Why I focus on Coda AI you can read here: ⤵️
I hope you enjoyed this article. If you have questions feel free to reach out. Though this article is for free, my work (including advice) won’t be, but there is always room for a chat to see what can be done. You find my (for free) contributions to the Coda Community and on Twitter.
Coda comes with a set of building blocks ー like pages for infinite depth, tables that talk to each other, and buttons that take action inside or outside your doc ーso anyone can make a doc as powerful as an app (source).
Not to forget: the Coda Community provides great insights for free once you add a sample doc.