Clearing Input Fields if Ticket not Found

Clearing Input Fields if Ticket not Found

Hi Zoho Team,

Requesting again for your insights/tips for the workflow that I have made recently 
here's the code: I'm still new to deluge and Zoho API so I need some help here.

Since our team has multiple department and what I'm trying to achieve here is the search function only search ticket information on a specific dept only and if user input a ticket number outside//non-existing of that department it will prompt an alert message - "Ticket not Found" then will clear the values of the input fields.

searchValue = {"ticketNumber":input.Ticket_Number.toLong()};
TicketRecord = zoho.desk.searchRecords(680xxxx,"Tickets",searchValue,0,5,"deskconnect");
for each  Ticket in TicketRecord.get("data")
{
if(Ticket.get("departmentId") == "35108xxxxxxxxx")
{
if(true)
{
                        X.....
                        X....
                        X......
input.Site_POC = Ticket.get("contact").get("firstName") + " " + Ticket.get("contact").get("lastName");
input.Phone_Number = Ticket.get("contact").get("mobile");
}
else
{
x....
                        x......
input.Site_Location = "";       //not working
input.Site_POC = "";            //not working
input.Phone_Number = ""; //not working
                        info "Ticket not Found"  //I guess I misunderstood here the function of INFO
}
}
}

    Zoho Desk Resources

    • Desk Community Learning Series


    • Digest


    • Functions


    • Meetups


    • Kbase


    • Resources


    • Glossary


    • Desk Marketplace


    • MVP Corner


    • Word of the Day


      Zoho CRM Plus Resources

        Zoho Books Resources


          Zoho Subscriptions Resources

            Zoho Projects Resources


              Zoho Sprints Resources


                Zoho Orchestly Resources


                  Zoho Creator Resources


                    Zoho WorkDrive Resources



                      Zoho Campaigns Resources

                        Zoho CRM Resources

                        • CRM Community Learning Series

                          CRM Community Learning Series


                        • Tips

                          Tips

                        • Functions

                          Functions

                        • Meetups

                          Meetups

                        • Kbase

                          Kbase

                        • Resources

                          Resources

                        • Digest

                          Digest

                        • CRM Marketplace

                          CRM Marketplace

                        • MVP Corner

                          MVP Corner




                          Zoho Writer Writer

                          Get Started. Write Away!

                          Writer is a powerful online word processor, designed for collaborative work.

                            Zoho CRM コンテンツ




                              ご検討中の方