Zoho Creator Deluge: How to Set Image SRC Easily

By - Anurag
03.03.25 9:20 AM

Zoho Creator is a versatile low-code platform that enables users to build custom applications tailored to their business needs. A common requirement in these applications is the ability to handle images—uploading, displaying, and manipulating them efficiently. Deluge, Zoho's proprietary scripting language, offers robust capabilities to manage these tasks seamlessly. This article delves into various methods to set the image source (SRC) in Zoho Creator using Deluge scripting, providing practical insights and examples.

Understanding Image Fields in Zoho Creator

Before diving into scripting, it's essential to comprehend how Zoho Creator manages image fields.An image field allows users to upload images either from their local computer or by specifying an image URL.Key configurations include:​

  • Alt Text:Provides alternative text when the image isn't displayed.
  • URL:Specifies a link to navigate when the image is clicked.
  • Title:Displays a tooltip when hovering over the image.
  • Target:Determines whether the link opens in the same window or a new one.

These settings enhance the accessibility and interactivity of your application.

Method 1: Uploading Images from a Local Computer

To facilitate image uploads from a local computer:

  1. Add an Image Field to Your Form:

    • Drag and drop the Image field into your form builder.
    • Name the field appropriately (e.g., "Product Image").
  2. Configure Field Properties:

    • Set the 'Browse Options' to 'Local Computer'.
    • Define 'Alt Text', 'URL', 'Title', and 'Target' as needed.
  3. User Interaction:

    • Users can upload images directly from their devices when filling out the form.

This method is straightforward and ideal for scenarios where users provide images during data entry.

Method 2: Setting Image SRC Using Deluge Scripting

In cases where images are stored externally, and you need to set the image source dynamically, Deluge scripting comes into play.Consider the following approach:

  1. Enable Image Field to Accept URLs:

    • Ensure the image field is configured to accept links, not just local uploads.
  2. Use Deluge Script to Set the Image URL:

    • Utilize a Deluge script to assign the image URL to the image field.

Here's an example script:

Zoho Creator Deluge: How to Set Image SRC Easily

This script assigns the specified URL to the image field, allowing the application to display the image from the external source. It's crucial to ensure that the image field is configured to accept URLs; otherwise, this approach won't work.

Method 3: Retrieving Uploaded Image SRC for Display

If you need to display an image that a user has uploaded via a form, follow these steps:

  1. Publish the Report Containing the Image:

    • Navigate to 'Settings' > 'Publish' > 'Publish Component'.
    • Select the report that contains the image field.
  2. Obtain the Embed Code:

    • Copy the generated embed code and paste it into a browser.
  3. Extract the Image SRC:

    • Right-click on the displayed image and inspect the element to retrieve the SRC attribute.

This method provides the direct URL of the uploaded image, which can be used elsewhere in your application.

Best Practices for Managing Images in Zoho Creator

  • Optimize Image Sizes:Ensure images are optimized for web use to enhance loading times and performance.
  • Use Descriptive Alt Text:Always provide meaningful alt text for accessibility and SEO benefits.
  • Secure Image Sources:When using external image URLs, ensure they are from secure and reliable sources to prevent broken links.
  • Regularly Update Image Links:Periodically verify that all image links are active and update them as necessary.
  • Conclusion

    Effectively managing images in Zoho Creator enhances the visual appeal and functionality of your applications. By leveraging Deluge scripting, you can dynamically set image sources, handle user uploads, and display images seamlessly. Implementing the methods discussed ensures a robust and user-friendly experience, catering to both informational and transactional intents.​

    Boost Your Zoho Skills Today!