Cliq Bot Connecting to CRM and getting back product prices, etc...

Cliq Bot Connecting to CRM and getting back product prices, etc...

My users are constantly looking up prices on desktop and in the field. Instead of the CRM I created a priceBot in Cliq that searches for a product name or part of it and spits results back to the user.

Might come in handy for someone. I'd like to further develop it by asking user questions if no results come back to help them find their item. For example if no results are brought back then ask user
- for category
- for description keywords
- price range

====
Steps:
1. Setup a connection to CRM. Click Integrations>Manage Connections > Add Connection
2. Once done grab the connection name
3. Create a Bot. Click Integrations>Create Bot (give it a name, etc...
4. Edit the message handler
5. Paste the code in the message handler section and insert your connection name (in bold below)
6. Click save and you should be good to go. User will have to subscribe to the bot.

NB: API V1
====

response = Map();
Name = user.get("first_name");
if(message.containsIgnoreCase("Hi") || message.containsIgnoreCase("Hey") || message.containsIgnoreCase("Hello") || message.containsIgnoreCase("need"))
{
response = {"text":"Hey *" + Name + "*, enter a product code and hit enter. I'll grab the price :search:"};
}
else if(message.containsIgnoreCase("help"))
{
response = {"text":"Enter a product name (full or partial) and I'll grab you a price(s). I only get new product prices at the moment. "};
}
else if(message.containsIgnoreCase("ok") || message.containsIgnoreCase("sure"))
{
response = {"text":"Great, give me a product code"};
}
else if(message.containsIgnoreCase("tnx") || message.containsIgnoreCase("Thank") || message.containsIgnoreCase("Great") || message.containsIgnoreCase("Cheers") || message.containsIgnoreCase("Best"))
{
response = {"text":"No prob *" + Name + "*"};
}
else
{
userInput = message;
products = zoho.crm._searchRecords("Products","(Product Name|contains|*" + userInput + "*)",0,50,"YOUR_CONNECTION");

if(products.size() > 0)
{
rows = List();
for each  pdt in products
{
row = Map();
row.put("Product",pdt.get("Product Name"));
row.put("Price",pdt.get("Unit Price").round(2));
row.put("Shipping",shipping);
row.put("Desc",pdt.get("Product Code"));
rows.add(row);

}

response = {"text":"See below prices.","card":{"theme":"modern-inline"},"styles":{"highlight":true},"slides":{{"type":"table","title":"List of Prices","data":{"headers":{"Product","Price","Shipping","Desc"},"rows":rows}}}};

}
else
{
response = {"text":":facepalm: Sorry, nada results for that. Try again... remember I'm only allowed search new Product Names at the moment"};
}
}
return response;





    Access your files securely from anywhere

        Zoho Developer Community




                                  Zoho Desk Resources

                                  • Desk Community Learning Series


                                  • Digest


                                  • Functions


                                  • Meetups


                                  • Kbase


                                  • Resources


                                  • Glossary


                                  • Desk Marketplace


                                  • MVP Corner


                                  • Word of the Day



                                      Zoho Marketing Automation
                                              • Sticky Posts

                                              • Convert a message on Cliq into a task on Zoho Connect

                                                Message actions in Cliq are a great way to transform messages in a conversation into actionable work items. In this post, we'll see how to build a custom message action that'll let you add a message as a task to board on Zoho Connect. If you haven't created
                                              • Cliq Bots - Post message to a bot using the command line!

                                                If you had read our post on how to post a message to a channel in a simple one-line command, then this sure is a piece of cake for you guys! For those of you, who are reading this for the first time, don't worry! Just read on. This post is all about how
                                              • Cliq Bots - How to make a bot respond to your messages?

                                                Bots are just like your buddies with whom you can interact. They carry out your tasks, keep you notified about your to-dos and come in handy when you need constant updates from a third party application.  So, how can you make your bot respond to a message? The bot message handler is a piece of code triggered when a message is sent to the bot. Message handlers help you customise your bot responses to make it look conversational. The message input from the user can be either a string or an option selected
                                              • Cliq Bots - Get notifications about any action on an application with the incoming webhook handler!

                                                Webhooks can be used to get notified about events happening in other applications inside Cliq. All bots in Cliq have their own incoming webhook endpoint. This makes it simple to post messages to the bot from external applications. Unlike the send message
                                              • The Slash Command Series - Types of Command Suggestions

                                                Hi Everybody! I hope you guys tried the /zdocs command and now have an idea of how command suggestions with click to execute work. If you have no clue of what command suggestion is, I recommend you to take a look at all the Slash Command Series posts, especially the one on Command Suggestions ! This post is all about the different types of command suggestions.  Customise your command suggestions  Did you know you could customise your command suggestion list with a title, description, image? Well,


                                              Manage your brands on social media



                                                    Zoho TeamInbox Resources

                                                      Zoho DataPrep Resources



                                                        Zoho CRM Plus Resources

                                                          Zoho Books Resources


                                                            Zoho Subscriptions Resources

                                                              Zoho Projects Resources


                                                                Zoho Sprints Resources


                                                                  Qntrl Resources


                                                                    Zoho Creator Resources



                                                                        Zoho Campaigns Resources


                                                                          Zoho CRM Resources

                                                                          • CRM Community Learning Series

                                                                            CRM Community Learning Series


                                                                          • Kaizen

                                                                            Kaizen

                                                                          • Functions

                                                                            Functions

                                                                          • Meetups

                                                                            Meetups

                                                                          • Kbase

                                                                            Kbase

                                                                          • Resources

                                                                            Resources

                                                                          • Digest

                                                                            Digest

                                                                          • CRM Marketplace

                                                                            CRM Marketplace

                                                                          • MVP Corner

                                                                            MVP Corner





                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now