Talking to Zoho Creator with Email

July 11, 2007

In Nora Ephron’s Six Stages of E-Mail she documents a gradual descent into madness that the medium tends to propel, saying that although in Stage Two a person tends to regard email as “revolutionary”, by Stage Four they are complaining of drowning in “112 unanswered e-mail messages”.

Fortunately email has other uses beyond helping you neglect correspondence with other people. Google Calendar will email you reminders from your schedule, Feedburner lets you send feed updates through email, and of course lots of newsletters and articles can still be delivered to you via email, though as time goes on people seem to prefer the Web for this sort of thing.

Of particular note when it comes to email’s versatility are automated systems that will send you their output in a message. Most of these are government services and many have been around for awhile; now either sitting next to or effectively eclipsed by more Web-centric applications, but there are still lots to choose from. Check out NASA’s J-Pass Generator, the joint U.S./British project known as INTERMAGNET, and France’s Navimail just to name a few.

Zoho Creator: Email as a data uploader

One little-used and/or little-publicized feature of Zoho Creator is the ability to update a form with an email instead of filling it out by hand:

Zoho Email Import

I don’t know how reliable this facility is or how often the updates run, but it opens up interesting possibilities. I’ve seen it take quite awhile for updates to occur and am not sure what determines when a message emailed into a ZC form will show up, but if you’re not in any hurry to see the data there’s room for experimentation here.

Requesting Airport Weather

Based on the idea that we could have a system out there on the internet do our updating for us, I published a ZC application called simply Airport Weather that demonstrates the concept. It stores about 1700 airports at various spots in the world and prompts you to select one so ZC can dispatch a request to the United State’s National Weather Service who will hopefully eventually reply and update the database with the results of your request.

It works by configuring the Zoho Creator’s sendmail() function to contact the NWS FTPMail system and tell it to send the results back to a ZC form:


sendmail
(
To : input.FTPMail
From : zoho.adminuserid
Subject : "Weather Request"
Message : input.Commands
)

Where input.Commands is a dynamically populated Multi Line field:

set Commands = "reply myzohoaccunt-999@forms.zohocreator.com\nopen\ncd data\ncd observations\ncd metar\ncd decoded\nget " + input.ICAOCode + ".TXT\nquit";

And input.ICAOCode is the International Civil Aviation Organization code for the airport.

This works because the NWS FTPMail service returns data in a way that ZC’s email feature can understand, i.e.:

Houston, Houston Hobby Airport, TX, United States (KHOU) 29-38-15N 095-16-57W 36M
Jul 10, 2007 - 06:53 PM EDT / 2007.07.10 2253 UTC
Wind: from the S (180 degrees) at 9 MPH (8 KT):0
Visibility: 10 mile(s):0
Sky conditions: partly cloudy
Temperature: 91.0 F (32.8 C)
Heat index: 100.2 F (37.9 C):1
Dew Point: 73.9 F (23.3 C)
Relative Humidity: 57%
Pressure (altimeter): 29.95 in. Hg (1014 hPa)
ob: KHOU 102253Z 18008KT 10SM SCT045 SCT250 33/23 A2995 RMK AO2 SLP146 T03280233
cycle: 23

Note that the application can’t grab the full airport name or UTC time since those aren’t in the only format ZC can handle: ‘field: value‘. We grab the Country and Airport name out of the local data after the email arrives by looking it up based on the ICAO code in the ob: field. If we wanted to we could also grab the less-friendly UTC time out of ob: (it directly follows the ICAO code, followed by a ‘Z’).

(You can get the Excel™ files used to import the Country and Airport data as well as the Airport Weather deluge script here.)

Collecting Space Weather data without human intervention

Another example of this sort of thing that doesn’t rely on any user input at all is another ZC application, Space Weather Alerts. It uses a free account at NOAA Space Weather Alerts site to send all the alerts to a Zoho form email address. You can see in the View that I haven’t yet figured out how to truncate the messages to leave out the NOAA Space Weather Scale descriptions can be found at www.sec.noaa.gov/NOAAscales message. Depending on which values are sent in a particular alert, that canned message gets stuck in whatever legitimate field was last sent. Those emails look like this:

Space Weather Message Code: WARK05
Serial Number: 608
Issue Time: 2007 Jul 11 0606 UTC

EXTENDED WARNING: Geomagnetic K-index of 5 expected
Extension to Serial Number: 607
Valid From: 2007 Jul 11 0145 UTC
Now Valid Until: 2007 Jul 11 1600 UTC
Warning Condition: Persistence

NOAA Space Weather Scale descriptions can be found at
www.sec.noaa.gov/NOAAscales

Conclusion

Zoho Creator is a great tool for exploring on-line application development. The email resources above don’t exactly provide exciting or hard-to-find data, but they do show how even a tiny bit of a Zoho Creator API (or AEI, “Application Email Interface”) provides for an extensible environment.

What I’d like to see from Zoho in the future would be more options for interacting with Creator, perhaps a REST API or something along those lines, or maybe just some more options for sending email into an application so we aren’t limited to the ‘name: value‘ format.

4 Responses to “Talking to Zoho Creator with Email”

  1. Hyther Nizam Says:

    Pete:

    This is really cool mashup. We haven’t thought our email-to-form feature could be used this way

    Since you opened up this topic, let me disclose it here. We are working on both REST and web service APIs for creator. Will ask my team to give you an early access.

    Looking forward for more such innovative way of using zoho :-)

    Hyther

  2. Pete Thomas Says:

    Thanks for stopping by, Hyther.

    That’s great news about the upcoming APIs, I’m very much looking forward to working with them.

    Thanks to your team for a great product and keep up the fantastic work!

  3. Victor Says:

    It’s great that Creator is getting REST and web service API’s. When is this going to happen for Zoho CRM???

  4. Dennis Says:

    Hi

    I see the Email as a data uploader, as a great opportunity for me to optimize my system. Have anyone created a system like this? Is it possible to see ho it is done?

    Hope to hear from you soon.

    Thanks for a very simpel and yet useful system!

    BR Dennis


Leave a Reply