Dynamically Display Images in Pages

Dynamically Display Images in Pages

Requirement

Dynamically display an image stored in the form in the Zoho Creator page.

Use Case

Imagine a Zoho Creator task management application employed to oversee tasks within an organization. Within the Dashboard page of this application, employees accessing the application will find their profile photo displayed based on their login email address. This provides a personalized and visually appealing user experience.

Steps to follow

  1. Create a form with the following details to record employee details.

    Form Name

    Form Link Name

    Field Type

    Field Name

    Fied Link Name

    Employee Details

    Employee_Details

    Name

    Employee Name

    Employee_Name

    Email

    Email

    Email

    Date

    Date of Birth

    Date_of_Birth

    Phone

    Phone

    Phone

    Address

    Address

    Address

    Single Line

    Employee ID

    Employee_ID

    Image

    Photo

    Photo

  2. Create a page named 'Dashboard' for the employees to view the tasks and its status upon accessing the application. Add required components according to your preferences. Refer to this link to view how to construct a dashboard for task management application as shown below.

  3. Drag and drop the HTML snippet into your Dashboard Page.

  4. Add the following script in the HTML snippet.
  1. <%{
  2. //Fetch the image URL of the employee photo uploaded in the Photo field of the Employee Details form with respect to the login user ID.
  3. image_link = Employee_Details[Email == zoho.loginuserid].Photo;
  4. //If the employee photo is fetched, replace the parameters in the fetched image URL.
  5. if(image_link!=null)
  6. {
  7. //Replace the parameters in the fetched image URL with the actual values using replaceAll() function.
  8. image_link = image_link.replaceAll("https://creatorexport.zoho.com/sharedBy/appLinkName/","https://creator.zoho.com" + zoho.appuri)
  9. image_link = image_link.replaceAll("viewLinkName","All_Employee_Details");
  10. image_link = image_link.replaceAll("fieldName","Photo");
  11. //Add the preferred HTML attributes at the end of the URL.
  12. image_link = image_link.replaceAll(">","width=\"140\" height=\"140\" style=\"display: flex; justify-content: center; align-items: center;\">");
  13. }
  14. //If the employee photo from the record is not fetched populate the snippet with default image.
  15. else
  16. {
  17. //Specify the public URL of the preferred image inside the <img> tag to display it as defauly when the record cannot be fetched.
  18. image_link = "<img src=\"https://desk.zoho.com/portal/api/kbCategory/4000000217879/logo/327583000026924010?orgId=4241905\" \"width=\"140\" height=\"140\" style=\"display: flex; justify-content: center; align-items: center;\">";
  19. }
  20. %>
  21. <%=image_link%>
  22. <%
  23. }%>

See How it Works


  1. Understand HTML snippets


      Create. Review. Publish.

      Write, edit, collaborate on, and publish documents to different content management platforms.

      Get Started Now


        Access your files securely from anywhere

          Zoho CRM Training Programs

          Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

          Zoho CRM Training
            Redefine the way you work
            with Zoho Workplace

              Zoho DataPrep Personalized Demo

              If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

              Zoho CRM Training

                Create, share, and deliver

                beautiful slides from anywhere.

                Get Started Now


                  Zoho Sign now offers specialized one-on-one training for both administrators and developers.

                  BOOK A SESSION







                              Quick LinksWorkflow AutomationData Collection
                              Web FormsRetailOnline Data Collection Tool
                              Embeddable FormsBankingBegin Data Collection
                              Interactive FormsWorkplaceData Collection App
                              CRM FormsCustomer ServiceForms for Solopreneurs
                              Digital FormsMarketingForms for Small Business
                              HTML FormsEducationForms for Enterprise
                              Contact FormsE-commerceForms for any business
                              Lead Generation FormsHealthcareForms for Startups
                              Wordpress FormsCustomer onboardingForms for Small Business
                              No Code FormsConstructionRSVP tool for holidays
                              Free FormsTravelFeatures for Order Forms
                              Prefill FormsNon-Profit
                              Forms for Government
                              Intake FormsLegal
                              Mobile App
                              Form DesignerHR
                              Mobile Forms
                              Card FormsFoodOffline Forms
                              Assign FormsPhotographyMobile Forms Features
                              Translate FormsReal EstateKiosk in Mobile Forms
                              Electronic FormsInsurance
                              Drag & drop form builder

                              Notification Emails for FormsAlternativesSecurity & Compliance
                              Holiday FormsGoogle Forms alternative GDPR
                              Form to PDFJotform alternativeHIPAA Forms
                              Email FormsWufoo alternativeEncrypted Forms
                              Accessible FormsTypeform alternativeSecure Forms

                              WCAG

                                          Create. Review. Publish.

                                          Write, edit, collaborate on, and publish documents to different content management platforms.

                                          Get Started Now






                                                            You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                                Manage your brands on social media

                                                                  Use cases

                                                                  Make the most of Zoho Desk with the use cases.

                                                                   
                                                                    

                                                                  eBooks

                                                                  Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho Desk.

                                                                   
                                                                    

                                                                  Videos

                                                                  Watch comprehensive videos on features and other important topics that will help you master Zoho Desk.

                                                                   
                                                                    

                                                                  Webinar

                                                                  Sign up for our webinars and learn the Zoho Desk basics, from customization to automation and more

                                                                   
                                                                    
                                                                  • Desk Community Learning Series


                                                                  • Meetups


                                                                  • Ask the Experts


                                                                  • Kbase


                                                                  • Resources


                                                                  • Glossary


                                                                  • Desk Marketplace


                                                                  • MVP Corner



                                                                    Zoho Sheet Resources

                                                                     

                                                                        Zoho Forms Resources


                                                                          Secure your business
                                                                          communication with Zoho Mail


                                                                          Mail on the move with
                                                                          Zoho Mail mobile application

                                                                            Stay on top of your schedule
                                                                            at all times


                                                                            Carry your calendar with you
                                                                            Anytime, anywhere




                                                                                  Zoho Sign Resources

                                                                                    Sign, Paperless!

                                                                                    Sign and send business documents on the go!

                                                                                    Get Started Now




                                                                                            Zoho TeamInbox Resources





                                                                                                      Zoho DataPrep Demo

                                                                                                      Get a personalized demo or POC

                                                                                                      REGISTER NOW


                                                                                                        Design. Discuss. Deliver.

                                                                                                        Create visually engaging stories with Zoho Show.

                                                                                                        Get Started Now









                                                                                                                            • Related Articles

                                                                                                                            • How to display images dynamically on a subform row based on the lookup field selection

                                                                                                                              The images stored in a form can be retrieved and displayed dynamically within subforms. When users select a record from a lookup field in a subform row, relevant images associated with that record can appear in a designated rich text field within the ...
                                                                                                                            • Having Images as choices for a question

                                                                                                                              Requirement A form containing questions must have multiple choices in image format as answers for each question. Use Case A brain-teaser application is built that has a Questions form, which lists all kinds of questions. A question has multiple ...
                                                                                                                            • Understand Pages

                                                                                                                              1. What Does This Page Cover? Learn about pages and how they are used to create user-friendly, customized dashboards for your applications. Via these dashboards, you can display dynamic elements and visually represent the data stored in Creator. 2. ...
                                                                                                                            • Understand Portal Pages

                                                                                                                              This help page is for users in Creator 6. If you are in the older version (Creator 5), click here. Know your Creator version. What Does This Page Cover? Learn about the Sign Up, Sign In, Create Password and Reset Password pages of your portal. They ...
                                                                                                                            • Customized search component for report data, using pages

                                                                                                                              Requirement             Provide a search component for users to search for the required data. Data is fetched from reports based on the search keyword. Use Case   A library or a book management system wants to allow for searching. Any customer who ...
                                                                                                                              Wherever you are is as good as
                                                                                                                              your workplace

                                                                                                                                Resources

                                                                                                                                Videos

                                                                                                                                Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                                                eBooks

                                                                                                                                Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                                                Webinars

                                                                                                                                Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                                CRM Tips

                                                                                                                                Make the most of Zoho CRM with these useful tips.



                                                                                                                                  Zoho Show Resources