The App Tips Blog: Using Data Decorator to Make Your Data Pretty

Posted 08/20/2010 - 11:25 by Blythe

5
Your rating: None Average: 5 (1 vote)

Every so often we find something in Presto 3.0 that is so cool and useful we want share these tips with you. These Tips aren’t a substitute for the Documentation, or the full-featured ‘How-Tos’. It’s just a quick attempt to save you time in your App-making with some of the best of Presto 3.0.

Today I wanted to ‘get pretty’ with the Data Decorator Block in Wires. And I’m going to conquer the teams of the World Cup at the same time!

Creating Mashups with your internal and external data can be pretty boring. The ‘Data Decorator’ block in Wires can add some spunk to an otherwise mundane piece of data. It’s an easy way for you to embellish and elaborate on your lists, databases, and RSS feeds with string and number functions like concentrate, replace/substitute, calculate, round, and a lot of other functions you might use in a spreadsheet.

I found the Data Decorator very helpful when trying to join or match the data between two or more sources and need make tweaks that make the matching/joining more accurate. For example, in my FIFA World Cup App, I wanted to match up the 32 country names on the FIFA site with those that are listed on the CIA WorldFactbook. There were ~7 country names that varied between the two sources; one had special characters (Côte D'ivoire was C??te D’ivoire), others didn't use the ISO country naming format. I used the Decorator ‘string replace’ function to simply select the entry the string was located under (‘country’), typed in the bugged or misspelled country name, and then typed in what I wanted the country to be called – for instance, I replaced South Korea with Republic of Korea. (See the pic for an example.)

You can learn more about Data Decorator in the Documentation. And you can see the Data Decorator in action in our video, “Making Mashables and Mashups for Beginners.”