Archive for the ‘Authors’ Category
May 4, 2008
I don’t know if many of you will remember me, but I was invited to be a guest-blogger here on Land of Zoho Creator last fall. After one post, I managed to disappear off the face of the Earth for a while, but hopefully I’m back to regular blogging and will be able to post a bit more frequently.
A while back, Pete shared a great tip for generating a direct link to edit a specific record in a Zoho Creator. This was a great tip, as this is a feature sadly lacking in Zoho Creator by default. The only drawback with this is that it only works for records that are publicly accessible.
Unfortunately for people storing sensitive information, such as e-mail addresses, it is not usually a good idea to make the records public. In particular, I’m thinking about an application that stores member, subscriber, or client information. Since this information can’t be made public, there’s no way for the user to be able to update his or her own information when an address, e-mail address, or other information changes.
However, if you’re willing to do a little bit of Deluge scripting, there is a way to get around this progromatically. All you need is the ability to have one unique field for each record (such as an e-mail address), or a combination of fields (such as a username and phone number/address).
Once your main “add a record” form has been created, create another duplicate form to use for updating records. This new form should have all of the same fields (at least, the ones you want users to be able to edit). Although you could put this functionality directly into the main form, your users won’t be able to save the record, or you might end up with duplicate data.
You’ll want to make your identifier field(s) the first field that will be filled out in the “update” form, and you may want to add a “Note” field to explain to people how this will work.
Add a “On Add -> Validate” script to your application. You can do this from from the Script page. Click on the “Validate” link under “On Add.” Drag a “Fetch Records” code block into the code section of the page and click the “edit” button to customize the code.
Select the form that holds the data you will be checking against (the primary form that holds the original data).
Enter a variable name to use for the record you select (this can be anything you want).
Finally, specify the criteria you will be using to select the record that matches the information the user has entered into the field(s) in your form (The “Criteria field” tab contains the field names for the record you are checking, and the “Input field” tab contains the field names for the currently open form). Set the criteria to select records where the criteria field(s) matches the input field(s). This can get a little confusing, since the field names will be the same, so pay attention to what you are doing. Be sure that the field(s) you are checking cannot possibly contain any duplicate values, or you may find that people are updating records other than their own.
After you’ve fetched the record containing the unique value(s) that your user has entered, you can use a series of “Update record” code blocks to update the fetched record with the new information that the user has submitted.
To make things easier for your user, you may want to pre-load their information after they have entered the unique value(s) to identify themselves. To do this, add an “On User Input” code block to the field that contains the unique value (You may want to do this for each field that contains user information if you don’t have a single unique field for each user).
Drag a “For each record” code block into this section, and use the same criteria to specify the matching record. Inside this code block, use a series of “Set variable” code blocks to set the input fields to the values in the matching record.
This way, your user will be able to see the values that were previously entered. It has the added benefit of ensuring that any fields the user doesn’t change don’t get replaced with “empty” data.
That’s all there is to it. It does take a little bit of coding to work, but it can be well worth it if you need to allow users to change information in a recordset that they don’t otherwise have access to.
This kind of functionality can be useful for updating general information, but can be particularly useful for people who use Zoho Creator to handle registrations for classes or events. Users will be happy knowing that they can change their minds later and update their information whenever they need to.
Incidentally, this same type of functionality can be used with the “show/hide” field codes. If you want to make certain fields in your form only available to “members,” you can use the “For each record” code block to validate the information they enter into one field to determine which fields are available for editing.
I hope you find this tip useful.
March 13, 2008
With this, my first post, I want to invite our readers to comment and vote on an idea we’ve been kicking around here - that of starting the Zoho Creator Depot (ZCD). As we currently envision it, ZCD would be a good destination if you’ve made up your mind about Zoho Creator as your platform of choice to deploy an application and you’re searching for tools, materials and advise or development help .
The ZCD would include:
-
A gallery of production-quality ZC components and applications.
-
Documented Case Studies and Success Stories.
-
A list of ZC developers and consultants, with their credentials and areas of expertise.
-
A knowledge base of different topics that apply to ZC.
-
Frameworks for developing or deploying mash-ups with Zoho Creator
-
A simple way to purchase previously developed components, applications or development services.
As a client of ZCD services, you could resell the application or component and recover part of your original investment. If you sell it multiple times you could conceivably make some money too. And if you’re a developer, ZCD would be a way to connect with your potential clients.
I’m just borrowing ideas from brick-and-mortar places I find useful, like Home Depot, the Weaver Street Market and Play it Again Sports. If there is enough intest in this we’ll go ahead and build some ZC forms, get a Zoho Wiki started and see where this takes us.
March 13, 2008
Those of you who visit this site directly might notice a new face in the sidebar. Although we have Lockworld to thank for some great posts about ZC and we were hoping to see more, Doug recently let it be known he was having difficulty finding time to post. Hence we invited a new face to LoZC and the face accepted — please welcome Gabriel Coch!
I’ll let Gabriel introduce himself through his own introductory post but I will point out that he’s one of those rare folk who combine technical acumen, business savvy, and a genuine desire to help people not only improve their daily lives through technology but also safeguard their communities.
In addition, Gabriel and I have been exploring over email and a couple phone conversations how we (we meaning us and YOU) can take ZC’s potential as a commercial business platform to “the next level”…though what that next level looks like is frankly unknown at this point. Part of Gabriel’s motivation for joining us, if I can presume to speak for him for just a moment, is to further this idea by harnessing a real ZC community.
I’m excited and hope you are too!
December 11, 2007
I got an email from Mark this morning saying he was in his first ice storm and that there’s one branch “above the power line that I’m concerned could fall and leave us offline for awhile” so who knows when we might hear from him. Best of luck, Mark!
November 11, 2007
Doug is continuing his series on using Zoho Creator JSON feeds as part of a client-side content management system or, more accurately, a content managment system that’s usable by folks who can’t or choose not to write server-side applications. In this latest post he’s building a facility for displaying a dynamic table of contents for pages hosted on sites like Microsoft Office Live Basics :
…if a specific article is requested in the URL (articles.aspx?271), the article will be displayed. If no article is requested (articles.aspx) or a nonexistent article is requested, the user will be shown a Table of Contents…
September 10, 2007
Hi everyone…my name is Doug Lockwood (AKA Lockworld), and I’ve been invited to join the Land of ZC blog. I’m excited to be here! I first started using Zoho Creator over a year ago, and was amazed at what I could do. However, I could never think of anything to do with it until a few months ago when I decided to start using it to build an online catalog of products/services for my Web site. Since then, I’ve been busy pushing the limits of Zoho Creator, and I’m very impressed! I’m also quite impressed with the Land of ZC…Pete has done an outstanding job of delving deep into the heart of Zoho Creator, and I’ve used the tips and tricks he’s provided to help get me through some of the rough spots. Naturally, when he invited me to share some of my ideas on this blog, I couldn’t resist. I am excited about this opportunity, and I hope you find my contributions useful.
If you’ve used Zoho Creator, you’re probably already familiar with exporting your forms and views as iframes or JavaScript codes to embed on your own Web site. In addition, you can find links to PDF, RSS, HTML, XLS, CSV, and other views of the data you have collected. These are very nice features, but there was one exportable feature that I had a little trouble figuring out…JSON feeds. If you click on the link to a JSON feed, you might see a bunch of garbled HTML. For example, I created a sample online catalog application to showcase my e-commerce solution a while back. I wanted to see what the JSON feed was all about, but when I clicked on the link, I saw quite a mess in my browser, as you can see in this link.
Little did I know how useful JSON would prove to be!
I did a Google search for JSON, and was able to find out a little more about it. Essentially, JSON is a very simplified JavaScript code that can turn your entire Zoho Creator view into a single variable using a form of nested arrays.
Parsing the codes out was a little bit tricky at first, but once I got the hang of it, it became fairly easy. You can add a simple tag to your Web page to load the JSON/JavaScript variable by using a script tag:
<script
src="http://creator.zoho.com/{USERNAME}/json/{VIEWNUMBER}/" mce_src="http://creator.zoho.com/{USERNAME}/json/{VIEWNUMBER}/"
></script>
Then in a separate script tag you can begin to parse out the values. Let’s try a simple example using the JSON feed described above…
Here’s a basic script that will display all of the product information available on this sample catalog directly in your Web site:
<script src="http://creator.zoho.com/lockworld/json/6/" mce_src="http://creator.zoho.com/lockworld/json/6/"></script>
<script>
for (var j=0; j<zoholockworldview6.catalog_example.length; j++){
var NewArray=zoholockworldview6.catalog_example[j];
var ItemName = NewArray.Item_name;
var ItemPrice = NewArray.Item_price;
var PayPal = NewArray.PayPal;
var Description = NewArray.Description;
var DetailLink = NewArray.DetailLink;
document.writeln("<p><b><i>" + ItemName + "</i></b>");
document.writeln(" $" + ItemPrice);
document.writeln("<br>");
document.writeln(PayPal);
document.writeln("<br>");
document.writeln(Description);
document.writeln("<br>");
document.writeln(DetailLink);
document.writeln("</p><hr>");
}
</script>
Please keep in mind that Zoho Creator sometimes changes your field names to avoid using spaces or unsupported characters, so look through your code to be sure that you have all of the correct field names or you’ll end up with nothing on your page.
Why use JSON instead of the default JavaScript Zoho Creator provides?
As a general rule, the JavaScript codes provided by Zoho Creator (look for the “Embed in your website” link under “More Actions” in any of your forms or views) are adequate for most users. However, there may be times when you need to customize the way the information is displayed in a way that Zoho Creator cannot support by default (by specifying font colors/attributes for specific fields, etc.).
Privacy
One benefit to JSON scripts is that you can use them on your Web page to display information from an otherwise private Zoho Creator view (if you enable private hyperlinks). So, if you don’t want people to be able to access the information in your application from the Zoho Creator site, you can keep the view private and use a private hyperlink to display the information on your own site exclusively.
Filtering
Furthermore, you can use this powerful scripting tool to filter out certain elements to further customize your page. You might want to pass some attributes to your Web site through the URL that can be compared to fields within the JSON feed to determine whether or not to display the information. I could very easily add a condition to the script above to only display items with a price below, say, $5.00. So it would be very easy to add another page to my online catalog that would only display the cheapest items for those who did not want to fish through all of my products.
Variable data
Another use for JSON feeds is to display variable data on a single Web page. For an example, see my online catalog ? I realize that I only have one product currently for sale, but you should get the idea about how this can work. Each of my products contains a “details” link (automatically created when I enter a new product into my Zoho Creator application) that takes you to the same ProductDetails.aspx page and passes a specific product code via the URL. The scripts on my page look at this value and determine which product information from the JSON script to display. So I only have to create one Web page to display any and all of my product details, regardless of how many (or few!) I have.
Combining Applications
If you want to get even more advanced, you can combine information from multiple Zoho Creator applications by accessing more than one JSON feed on a single page…this might be a way to provide a level of security to your page by requiring that a person enter a unique ID or confirmation code from one Zoho Creator application on your page before displaying information from a different application…so you can have your “authorized users” application and all of your other applications available separately, but working together on your page. You should warn your users that this information can be hacked quite easily, so they shouldn’t provide a real username/password combination, or provide any other information they want to protect, but for a general level of usability, this provides some strong functionality.
Conclusion
Using Zoho Creator and JSON scripts, I have not only been able to create an online catalog with full PayPal support, but I have also created a content management system that allows me to add, remove, or edit records directly in Zoho Creator and have the updates automatically applied directly on my Web site. I will talk more about using Zoho Creator’s JSON feeds to create a content management system for your entire Web site in upcoming posts on The Web for You.
Now that’s powerful stuff, especially from a free Web tool!