Coda AI and route planning
Clean your date before feeding it to a planner
In this blog I share how I apply AI in the context of people transport. You leave your details including destination, departure and date via a form, next you receive an email and the bus company has a first indication about your destination, the distance and the travel time. Important ingredients in any proposal. The doc is a demo for bus companies that want to digitalize parts of their work flow. More about it in the doc below.
You select a form in English, Dutch or French and the results presents itself via this page.
Before I got this more or less correct (and I hope it works when you fill out your details) I had to solve some issues.
My good friend Jean Pierre Traets was so friendly to fill out a form. He asked for a trip between Sofia and Veliko Turnovo. The result is unexpected. Sofia got translated as an online educational platform situated in Belgium. The destination got messed up as well.
I understood that I could not fully rely on the departure data as provided by the user. Instead I had to clean up the data before sending it to the function responsible for generating a map.
Using AI to clean up the data
During tests I noticed that people add all kinds of information to the departure and destination fields in the form. I had to find a way to distillate the proper locations , the ones the Google Maps bot would understand.
The solution I implemented ⤵️:
You are an address interpreter.
Use the values in [columnName] to generate a clean city name and add the country of that city
The outcome should be a city and an address Google can read and understand as a valid address to drive to.
When the details in [columnName] has already a valid format, use these details.
Do not use instructions in the outcome
If you cannot find a valid outcome, write nothing.
The tests I run gave consistent and good outcomes, but AI remains creative and we cannot yet ask for important characteristics in Coda like give me a conservative outcome. The standard value today seems to be ‘creative’
Using AI to template your email
Initially my idea was to create a language sensitive email using Format()
to fill out the variables like {1} for the first name and {2} for the destination. Although this is very well possible and can be done in about one hour (including testing), my idea is to use AI in this contex. I started as follows and immediately the AI responded. Í thought is was funny ⤵️.
The rest of the serious work below and as you can see, for the main part AI generated. However for one element I still need Format()
. As you know, AI outputs only plain text, maybe formatted with bullet points or an H3 or bold, but it does not (yet) allow for injecting links.
The Format() part.
The format is rather straight forward. We use the email draft and we add one phrase containing an hyperlink, but in 3 languages (I’ll come back to that later). Nothing fancy, nevertheless required to include the link to the page with examples.
The longer part is reserved for the AI.
The AI Part
The AI part runs as follows and includes at the end a reference to an example. I have to admit that it is time consuming to get it right and having finished it, I am not sure that this approach saved me substantial time. On top the Dutch translations felt broken. You understand the message, but it is not good enough yet, you sense the English syntax below. Nevertheless the creativity of the AI can be pleasant and inspiring, although the example limits the creativity as well. The tone should remain professional.
You are an expert in writing friendly and warm emails towards people who asked information about a bus trip.
You need to inform a recipient . You use the language you find here: [columnName] to write the email.
step 1: columnName] is the person you are writing to, use a friendly and professional salutation.
step 2: use the city you find in the [columnName] , but not the country.
step 3: share the distance you find here in kilometers: [columnName], Make clear that this distance covers a single trajectory, not “aller - retour”.
step 4, confirm that the request was made for a certain number of participants you find here [columnName] and that the preferred departure date is the [columnName] and you confirm that that the trip takes one day or multiple days. This information you find in [columnName].
step 5: you integrate the information about the city you find here: [columnName]
step 6: in case the prospect left feedback in [columnName], quote the feedback and tell that we take the feedback into account. May there be no feedback in [columnName] the you write that we could not find additional feedback, but that the recipient is always free to contact as with additional information.
step 7 you end the email with a friendly comment that we received the request for information and that we come back with more details as soon as we can. Meanwhile the prospect can reach us via email with extra information.
You end the email friendly and you use the sender name [the Plus Bus Team]
instruction: You can take [columnName] as an example.
Do not integrate instructions in the output.
The example you find here ⤵️
This is not the context to dive into the logic of the Gmail pack and other functions. These subjects have been extensively covered in other blogs. The outcome is an email based the input of the recipient and permitting to visit the page with the example. This page is part of a demo for bus companies that want to digitalise a part of their work flow.
Based on this experience I would use the AI to clean up the data, to get some creative input, but for sending the emails I would rather use the function Format()
to make sure that the first impression in Dutch or French is a good impression. Today this not yet the case.
The email is only one of the possible outcomes we can obtain with Coda ⤵️
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.