<?xml version="1.0" encoding="UTF-8" ?><!-- generator=Zoho Sites --><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><atom:link href="https://www.blungo.com/blogs/tag/function/feed" rel="self" type="application/rss+xml"/><title>blungo - Blog #function</title><description>blungo - Blog #function</description><link>https://www.blungo.com/blogs/tag/function</link><lastBuildDate>Wed, 08 Oct 2025 15:59:45 -0700</lastBuildDate><generator>http://zoho.com/sites/</generator><item><title><![CDATA[Working with Multi-Select Look Up fields in Zoho CRM]]></title><link>https://www.blungo.com/blogs/post/working-with-multi-select-look-up-fields-in-zoho-crm</link><description><![CDATA[<img align="left" hspace="5" src="https://www.blungo.com/Blogpost/Thumbnails/Working with multi select lookup fields Zoho CRM.png"/>In this tutorial, we are going to show you how two different ways to find the Linking Module API fields, and we are going to review an example of how to search for records in a Multi-Select Look Up field.]]></description><content:encoded><![CDATA[<div class="zpcontent-container blogpost-container "><div data-element-id="elm_8IviC7roTWy1pB8T5m2pag" data-element-type="section" class="zpsection "><style type="text/css"></style><div class="zpcontainer-fluid zpcontainer"><div data-element-id="elm_QTBrCAUDSOyFRlCdpLN1GQ" data-element-type="row" class="zprow zprow-container zpalign-items- zpjustify-content- " data-equal-column=""><style type="text/css"> [data-element-id="elm_QTBrCAUDSOyFRlCdpLN1GQ"].zprow{ border-radius:1px; } </style><div data-element-id="elm_VoIP_gLFRbaPD-J1OwS1cA" data-element-type="column" class="zpelem-col zpcol-12 zpcol-md-12 zpcol-sm-12 zpalign-self- "><style type="text/css"> [data-element-id="elm_VoIP_gLFRbaPD-J1OwS1cA"].zpelem-col{ border-radius:1px; } </style><div data-element-id="elm_eFvagBqz9_P8zVMGB-Q3bA" data-element-type="iframe" class="zpelement zpelem-iframe "><style type="text/css"> [data-element-id="elm_eFvagBqz9_P8zVMGB-Q3bA"].zpelem-iframe{ border-radius:1px; } </style><div class="zpiframe-container zpiframe-align-center"><iframe class="zpiframe " src="https://www.youtube.com/embed/MgBWS7KKC9k" width="560" height="315" align="center" allowfullscreen frameBorder="0"></iframe></div>
</div><div data-element-id="elm__bttFMMbQBeQgsOADxw2gg" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm__bttFMMbQBeQgsOADxw2gg"].zpelem-heading { border-radius:1px; } </style><h2
 class="zpheading zpheading-align-left " data-editor="true">What we are going to do</h2></div>
<div data-element-id="elm_FZnVjR5LTqSOKJv9JmBOGQ" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_FZnVjR5LTqSOKJv9JmBOGQ"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><p>In this tutorial&nbsp;<span style="color:inherit;">we are going to show you how two different ways to find the Linking Module API fields, and we are going to review an example of how to search for records in a Multi-Select Look Up field.</span></p><p><span style="color:inherit;"><br></span></p><p><span style="color:inherit;">When you create a Multi-Select Look Up fields (MSLU), a new module called &quot;Linking Module&quot; is created. This module holds some basic information about how the two records are related. The Linking Module has it's own API name, so if you want to use it in a function, you have to know the API name. There are 2 ways you can get the API Name: searching in the CRM settings, or using a custom function.</span></p></div>
</div><div data-element-id="elm_DiNwxandSxP56pZ4iGSklA" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_DiNwxandSxP56pZ4iGSklA"].zpelem-heading { border-radius:1px; } </style><h2
 class="zpheading zpheading-align-left " data-editor="true">Linking Module API Name</h2></div>
<div data-element-id="elm_0-bi_BpOoQy3M0_uVCAdkQ" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_0-bi_BpOoQy3M0_uVCAdkQ"].zpelem-heading { border-radius:1px; } </style><h4
 class="zpheading zpheading-align-left " data-editor="true">CRM Settings</h4></div>
<div data-element-id="elm_Xxk_NPeah5V5w4v05pp0BQ" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_Xxk_NPeah5V5w4v05pp0BQ"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><div>This is seems like the easy way to do it, but it might be more complicated than using a custom function. The issue with this way is that you have to make some assumptions. Normally, your assumptions will be correct, but there's a small chance that the name of one of the modules linked by the Linking module was changed, and this could conflict with the setup.</div><div><br></div><div><span style="text-decoration-line:underline;">Here's how to do it:</span></div><div><ol><li>In the CRM, go to the setup.</li><li>On the search bar, look for &quot;CRM API&quot;, and open the first result.</li><li>Click on the &quot;API names&quot; sub-tab.</li><li>Open any of the modules listed here.</li><li>Now, on the &quot;filters by&quot; section, click on the modules field.</li><li>If you scroll all the way down, you will find the Linking Modules.</li></ol><div><br></div></div><div><span style="color:inherit;"><img src="/Sun%20Mar%2005%202023.png" alt=""></span><br></div><div><span style="color:inherit;"><br></span></div><div><span style="color:inherit;">The Linking Module API name is the module name &quot;Contacts X Properties&quot;, but you have to replace the spaces with underscores like this &quot;Contacts_X_Properties&quot;. Now, if any of the modules' names changed, this method might not work for you.</span></div><div><span style="color:inherit;"><br></span></div><div>If you open any Linking Module, you will see the fields related to the module. We are going to use some of the fields in the example that you can find at the end of this article.</div><div><br></div><div><img src="/Sun%20Mar%2005%202023-3.png" alt="" style="color:inherit;"><span style="color:inherit;"><img alt="" id="imageUriImported"></span><span style="color:inherit;"><br></span></div></div>
</div><div data-element-id="elm_EAQOwjjvCyAgzI82YSDjog" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_EAQOwjjvCyAgzI82YSDjog"].zpelem-heading { border-radius:1px; } </style><h4
 class="zpheading zpheading-align-left " data-editor="true">Custom function</h4></div>
<div data-element-id="elm_42GNThegWdwOaqwQW9cfrw" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_42GNThegWdwOaqwQW9cfrw"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><div>This method is more complicated, but always gives you the correct Linking Modules API Names.</div><div><br></div><div><span style="text-decoration-line:underline;">Add a connection:</span></div><div><ol><li>In the CRM, go to the Setup.</li><li>Under &quot;developer space&quot;, click on &quot;connections&quot;.</li><li>Click on &quot;create connection&quot;.</li><li>The service is &quot;Zoho OAuth&quot;.</li><li>Name the connection. We are going to use &quot;linking_module_API&quot;.</li><li>The scope is &quot;ZohoCRM.settings.modules.ALL&quot;. Use the magnifier to easily find it.</li><li>Click on &quot;create and connect&quot;.</li><li>Click on &quot;connect&quot; and allow any permissions you are requested.</li></ol></div><div><br></div><div><span style="text-decoration-line:underline;">Create the function:</span></div><div><div style="color:inherit;"><div><ol><li>In the CRM, go to the Setup.</li><li>Under &quot;developer space&quot;, click on &quot;functions&quot;.</li><li>Create a new function with the &quot;new function&quot; button.</li><li>Name the function.</li><li>The category is &quot;automation&quot;.</li><li>Click on &quot;create&quot;.</li><li>Copy the first code listed below (called &quot;Find Linking Modules API Names&quot;)</li><li>Paste the code in the function.</li><li>Replace the connection name with the name of the connection created in the previous step.</li><li>Click on &quot;Save &amp; Execute&quot;.</li></ol></div><div><br></div><div>The console will give you a list of the Linking Modules API names.</div></div></div></div>
</div><div data-element-id="elm_ciq0YZMJ43EG0UdZ9rjivg" data-element-type="box" class="zpelem-box zpelement zpbox-container zpdefault-section zpdefault-section-bg "><style type="text/css"> [data-element-id="elm_ciq0YZMJ43EG0UdZ9rjivg"].zpelem-box{ background-color:#C4E8A1; background-image:unset; border-style:solid; border-color:#1D90E2 !important; border-width:1px; border-radius:5px; padding:20px; } </style><div data-element-id="elm_KmFzfv5GP7K1sB8gq6TcFg" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_KmFzfv5GP7K1sB8gq6TcFg"].zpelem-text { border-radius:1px; padding:0px; margin:0px; } </style><div class="zptext zptext-align-left " data-editor="true"><span style="font-size:16px;">// Finding Linking Modules API Names</span><div style="color:inherit;"><div> get_linking_modules_api = invokeurl </div>
<div> [ </div><div> url :&quot;https://www.zohoapis.com/crm/v3/settings/modules&quot; </div>
<div> type :GET </div><div> connection:&quot;<span style="color:inherit;">linking_module_api</span>&quot; </div>
<div> ]; </div><div> modules_info = get_linking_modules_api.get(&quot;modules&quot;); </div>
<div> for each&nbsp; item in modules_info </div><div> { </div><div> module_type = item.get(&quot;generated_type&quot;); </div>
<div> if(module_type == &quot;linking&quot;) </div><div> { </div><div> module_api = item.get(&quot;api_name&quot;); </div>
<div> info module_api; </div><div> } </div><div> } </div></div></div></div></div>
<div data-element-id="elm_qQGrfB2Sl8Sn6lgzL7Je6w" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_qQGrfB2Sl8Sn6lgzL7Je6w"].zpelem-heading { border-radius:1px; } </style><h2
 class="zpheading zpheading-align-left " data-editor="true">Example: Contacts and Properties Multi-Look Up Field</h2></div>
<div data-element-id="elm_wdrQLI4Zx4Q1mAJZ5SqRng" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_wdrQLI4Zx4Q1mAJZ5SqRng"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><div>Let's say we have a custom module called Properties, that is related to the Contacts module. In the Contacts layout, we have a MSLU field where you can select multiple Properties.</div><div><br></div><div>If you try to get information from the MSLU using the &quot;get&quot; function, the result will be a string of text with all the Property names combined. There's no JSON with the Properties IDs or names.</div><div><br></div><div>Below you will find the function that you can copy and paste. We are going to explain each section individually. Make sure to add &quot;contact_id&quot; as an string in the arguments.</div><div><br></div><div>1)&nbsp;<span style="color:inherit;">property_list = zoho.crm.searchRecords(&quot;Contacts_X_Properties&quot;,&quot;(Property_Contact:equals:&quot; + contact_id + &quot;)&quot;);</span></div><div><span style="color:inherit;">This line uses the &quot;contact_id&quot; to search for all the properties that are linked to the Contact via the Linking Module. The &quot;Property_Contact&quot; API name can found by following the steps on the first section of this article. This function will return one o multiple results in a JSON.</span></div><div><br></div><div>2)&nbsp;<span style="color:inherit;">for each&nbsp; item in property_list</span></div><div>Now we are going over each result, and we will use some functions to get data from the properties.</div><div><br></div><div>3)&nbsp;<span style="color:inherit;">Property_id = item.get(&quot;Related_Properties&quot;).get(&quot;id&quot;);</span></div><div><span style="color:inherit;">We are getting the property ID using the field &quot;Related_Properties&quot; from the Linking Module.</span></div><div><span style="color:inherit;"><br></span></div><div><span style="color:inherit;">4)&nbsp;</span><span style="color:inherit;">Propert_info = zoho.crm.getRecordById(&quot;Properties&quot;,Property_id);</span></div><div><span style="color:inherit;">Now that we have the property ID, we can search for that property and get all the information related to it.</span></div><div><span style="color:inherit;"><br></span></div><div><span style="color:inherit;">5)&nbsp;</span><span style="color:inherit;">Property_name = Propert_info.get(&quot;Name&quot;);</span></div><div>From line 4, we can get, for example, the property name.</div><div><br></div><div>6)&nbsp;<span style="color:inherit;">Propery_sq = Propert_info.get(&quot;Sq_Footage&quot;);</span></div><div><span style="color:inherit;">From line 4, we can also get any other information stored in the property. In this case, we are getting the Square Footage.</span></div></div>
</div><div data-element-id="elm_OkwzJJoROSyyuERDXa7sZw" data-element-type="box" class="zpelem-box zpelement zpbox-container zpdefault-section zpdefault-section-bg "><style type="text/css"> [data-element-id="elm_OkwzJJoROSyyuERDXa7sZw"].zpelem-box{ background-color:#C4E8A1; background-image:unset; border-style:solid; border-color:#1D90E2 !important; border-width:1px; border-radius:5px; padding:20px; } </style><div data-element-id="elm_N3c9HSSF7CJcos94xnoSDQ" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_N3c9HSSF7CJcos94xnoSDQ"].zpelem-text { border-radius:1px; padding:0px; margin:0px; } </style><div class="zptext zptext-align-left " data-editor="true"><span style="font-size:16px;">// Example</span><div><span style="font-size:16px;"><div style="color:inherit;"><div>property_list = zoho.crm.searchRecords(&quot;Contacts_X_Properties&quot;,&quot;(Property_Contact:equals:&quot; + contact_id + &quot;)&quot;);</div><div>for each&nbsp; item in property_list</div><div>{</div><div>Property_id = item.get(&quot;Related_Properties&quot;).get(&quot;id&quot;);</div><div>Propert_info = zoho.crm.getRecordById(&quot;Properties&quot;,Property_id);</div><div>Property_name = Propert_info.get(&quot;Name&quot;);</div><div>info Property_name;</div><div>Propery_sq = Propert_info.get(&quot;Sq_Footage&quot;);</div><div>info Propery_sq;</div><div>}</div></div></span></div></div>
</div></div></div></div></div></div></div> ]]></content:encoded><pubDate>Thu, 09 Mar 2023 12:24:34 -0800</pubDate></item><item><title><![CDATA[How to Create a ChatGPT Bot in Zoho Cliq]]></title><link>https://www.blungo.com/blogs/post/Create-a-ChatGPT-Bot-Zoho-Cliq</link><description><![CDATA[<img align="left" hspace="5" src="https://www.blungo.com/Blogpost/Thumbnails/Create a chatgpt bot in zoho cliq.png"/>In this tutorial we are going to go over how to create a bot that uses the ChatGPT API to respond to our questions. Once the bot is ready, we are going to add it to a channel. You will be able to use the bot directly or through the channel.]]></description><content:encoded><![CDATA[<div class="zpcontent-container blogpost-container "><div data-element-id="elm_8IviC7roTWy1pB8T5m2pag" data-element-type="section" class="zpsection "><style type="text/css"></style><div class="zpcontainer-fluid zpcontainer"><div data-element-id="elm_QTBrCAUDSOyFRlCdpLN1GQ" data-element-type="row" class="zprow zprow-container zpalign-items- zpjustify-content- " data-equal-column=""><style type="text/css"> [data-element-id="elm_QTBrCAUDSOyFRlCdpLN1GQ"].zprow{ border-radius:1px; } </style><div data-element-id="elm_VoIP_gLFRbaPD-J1OwS1cA" data-element-type="column" class="zpelem-col zpcol-12 zpcol-md-12 zpcol-sm-12 zpalign-self- "><style type="text/css"> [data-element-id="elm_VoIP_gLFRbaPD-J1OwS1cA"].zpelem-col{ border-radius:1px; } </style><div data-element-id="elm_KGYXp4_7hZ9F7ojhEVtoDw" data-element-type="iframe" class="zpelement zpelem-iframe "><style type="text/css"> [data-element-id="elm_KGYXp4_7hZ9F7ojhEVtoDw"].zpelem-iframe{ border-radius:1px; } </style><div class="zpiframe-container zpiframe-align-center"><iframe class="zpiframe " src="https://www.youtube.com/embed/rWeRia2SJrw" width="560" height="315" align="center" allowfullscreen frameBorder="0"></iframe></div>
</div><div data-element-id="elm__bttFMMbQBeQgsOADxw2gg" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm__bttFMMbQBeQgsOADxw2gg"].zpelem-heading { border-radius:1px; } </style><h2
 class="zpheading zpheading-align-left " data-editor="true">What we are going to do</h2></div>
<div data-element-id="elm_FZnVjR5LTqSOKJv9JmBOGQ" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_FZnVjR5LTqSOKJv9JmBOGQ"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><p>In this tutorial we are going to go over how to create a bot that uses the ChatGPT API to respond to our questions. Once the bot is ready, we are going to add it to a channel. You will be able to use the bot directly or through the channel.&nbsp;<span style="color:inherit;">We are going to use the ChatGPT-3 API, that is not the latest version. The ChatGPT-4 API is not available at the time of creating this tutorial. Once the newer API version is available, we will edit this article.</span></p><p><span style="color:inherit;"><br></span></p><p>If you would like to learn how to create a Slash Command to ask questions to ChatGPT, check out this link.</p></div>
</div><div data-element-id="elm_DiNwxandSxP56pZ4iGSklA" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_DiNwxandSxP56pZ4iGSklA"].zpelem-heading { border-radius:1px; } </style><h2
 class="zpheading zpheading-align-left " data-editor="true">Pre-requisites</h2></div>
<div data-element-id="elm_Xxk_NPeah5V5w4v05pp0BQ" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_Xxk_NPeah5V5w4v05pp0BQ"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><ul><li>An OpenAI account.</li></ul></div>
</div><div data-element-id="elm_qQGrfB2Sl8Sn6lgzL7Je6w" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_qQGrfB2Sl8Sn6lgzL7Je6w"].zpelem-heading { border-radius:1px; } </style><h2
 class="zpheading zpheading-align-left " data-editor="true">Creating the Bot</h2></div>
<div data-element-id="elm_TFRPDqt8lz3vXWSnA1aVhQ" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_TFRPDqt8lz3vXWSnA1aVhQ"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><ol><li>In Zoho Cliq, click on your profile picture, and go to &quot;Bots &amp; Tools&quot;.</li><li>On the Bots tab, click on the &quot;Create Bot&quot; button<br></li><li>Name the Bot: for this example we are going to name it &quot;ChatGPT&quot;</li><li>Choose the access level: we are going to choose &quot;organization&quot;, so anyone in our organization can use this bot</li><li><span style="color:inherit;">Under Channel Participation, select &quot;Allow users to add this bot to any channel&quot;. Also check &quot;Send messages&quot;, &quot;Listen to Messages&quot; and &quot;auto-follow threads&quot;. This is important because we are going to add the bot to a channel later on.</span><br></li><li>Optional: add a bot image</li><li>Click on &quot;Save Bot&quot;</li></ol></div>
</div><div data-element-id="elm_KeLLX98_CvputMb1INmu8A" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_KeLLX98_CvputMb1INmu8A"].zpelem-heading { border-radius:1px; } </style><h2
 class="zpheading zpheading-align-left " data-editor="true">Adding the Message Handler Code</h2></div>
<div data-element-id="elm_HgKHqzMlyLRFf0srvnx6Kg" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_HgKHqzMlyLRFf0srvnx6Kg"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><ol><li>On the &quot;Bots&quot; tab, hover over the bot and click on &quot;Edit Handlers&quot;<br></li><li>Now click on &quot;Edit Code&quot; below &quot;Message Handler&quot;</li><li>Copy the code below.</li><li>Paste the code in the code box.</li><li>In OpenAI account, go to the settings and click on the &quot;API Keys&quot; tab (or use <a href="https://platform.openai.com/account/api-keys" title="this link" rel="">this link</a>).<br></li><li>Generate a new secret key and copy it.</li><li>Back in Zoho Cliq, replace the key &quot;XXXXXXXXXXXX&quot; with the one you generated.<br></li><li>Cliq on Save.</li></ol><div><br></div><div>That's it. The bot should be working. To test it, you can use the side chat panel. The first time you try to use it, you will have to grant some permissions first.</div></div>
</div><div data-element-id="elm_ciq0YZMJ43EG0UdZ9rjivg" data-element-type="box" class="zpelem-box zpelement zpbox-container zpdefault-section zpdefault-section-bg "><style type="text/css"> [data-element-id="elm_ciq0YZMJ43EG0UdZ9rjivg"].zpelem-box{ background-color:#B2EA79; background-image:unset; border-style:solid; border-color:#04EA04 !important; border-width:1px; border-radius:5px; padding:20px; } </style><div data-element-id="elm_KmFzfv5GP7K1sB8gq6TcFg" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_KmFzfv5GP7K1sB8gq6TcFg"].zpelem-text { border-radius:1px; padding:0px; margin:0px; } </style><div class="zptext zptext-align-left " data-editor="true"><div style="color:inherit;"><div>//Message Handler Code</div><div>response = Map();</div><div><span style="color:inherit;">question = message;</span><br></div><div>// Add Open AI token</div><div>token = &quot;Bearer XXXXXXXXXXXX&quot;;</div><div>//</div><div>header = Map();</div><div>header.put(&quot;Authorization&quot;,token);</div><div>header.put(&quot;Content-Type&quot;,&quot;application/json&quot;);</div><div>params = {&quot;model&quot;:&quot;text-davinci-003&quot;,&quot;prompt&quot;:question,&quot;temperature&quot;:0.4,&quot;top_p&quot;:1,&quot;max_tokens&quot;:256,&quot;frequency_penalty&quot;:0,&quot;presence_penalty&quot;:0,&quot;stop&quot;:{&quot; Human:&quot;,&quot; AI:&quot;}};</div><div>fetchCompletions = invokeurl</div><div>[</div><div>url :&quot;https://api.openai.com/v1/completions&quot;</div><div>type :POST</div><div>parameters:params.toString()</div><div>headers:header</div><div>detailed:true</div><div>];</div><div>info &quot;Fetch completions: &quot; + fetchCompletions;</div><div>if(fetchCompletions.get(&quot;responseCode&quot;) == 200)</div><div>{</div><div>answer = fetchCompletions.get(&quot;responseText&quot;).get(&quot;choices&quot;).getJSON(&quot;text&quot;);</div><div>response.put(&quot;text&quot;,answer);</div><div>}</div><div>else if(fetchCompletions.get(&quot;responseCode&quot;) == 429)</div><div>{</div><div>response = {&quot;text&quot;:&quot;I can't help with this. Try asking something else.&quot;};</div><div>}</div><div>return response;</div></div></div>
</div></div><div data-element-id="elm_1jctI-J1lJnhrIE6XeStEw" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_1jctI-J1lJnhrIE6XeStEw"].zpelem-heading { border-radius:1px; } </style><h2
 class="zpheading zpheading-align-left " data-editor="true">Adding the Bot to a Channel and edit the Participation Handler</h2></div>
<div data-element-id="elm_75pcWOdATZDgq5ZJJ-cggg" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_75pcWOdATZDgq5ZJJ-cggg"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><ol><li>Add the bot to the channel, as you would add a user to the channel.</li><li>Now go to &quot;Bots &amp; Tools&quot;.</li><li>On the &quot;Bots&quot; tab, hover over the ChatGPT Bot and click on &quot;Edit Handlers&quot;.<br></li><li>Now click on &quot;Edit Code&quot; below &quot;Participation Handler&quot;.</li><li>Copy the code below.</li><li>Paste the code in the code box.</li><li>Save the changes.</li><li>Go back to the &quot;Message Handler&quot; code, and copy the ChatGTP API Key.</li><li>Back in the &quot;Participation Handler&quot;, replace the key &quot;XXXXXXXXXXXX&quot; with the one you copied.<br></li><li>Save the changes again.</li></ol><div><br></div><div>The bot is ready to answer to any questions you post on the channel. To test it out, just send a message in the channel and wait for the ChatGPT response.</div></div>
</div><div data-element-id="elm_GPq2-zqqgLsxBsLmbZtlvg" data-element-type="box" class="zpelem-box zpelement zpbox-container zpdefault-section zpdefault-section-bg "><style type="text/css"> [data-element-id="elm_GPq2-zqqgLsxBsLmbZtlvg"].zpelem-box{ background-color:#B2EA79; background-image:unset; border-style:solid; border-color:#04EA04 !important; border-width:1px; border-radius:5px; padding:20px; } </style><div data-element-id="elm_0MijW0jMrmIgU75cTL4EWg" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_0MijW0jMrmIgU75cTL4EWg"].zpelem-text { border-radius:1px; padding:0px; margin:0px; } </style><div class="zptext zptext-align-left " data-editor="true"><div style="color:inherit;"><div>//Participation Handler Code</div><div><div style="color:inherit;"><div style="color:inherit;"><div>response = Map();</div><div>if(operation == &quot;message_sent&quot;)</div><div>{</div><div>if(data.get(&quot;message&quot;).get(&quot;type&quot;) == &quot;text&quot;)</div><div>{</div><div>response = Map();</div><div>question = data.get(&quot;message&quot;).get(&quot;text&quot;);</div><div>token = &quot;Bearer XXXXXXXXXXXX&quot;;</div><div>header = Map();</div><div>header.put(&quot;Authorization&quot;,token);</div><div>header.put(&quot;Content-Type&quot;,&quot;application/json&quot;);</div><div>params = {&quot;model&quot;:&quot;text-davinci-003&quot;,&quot;prompt&quot;:question,&quot;temperature&quot;:0.9,&quot;max_tokens&quot;:256,&quot;top_p&quot;:1,&quot;frequency_penalty&quot;:0,&quot;presence_penalty&quot;:0,&quot;stop&quot;:{&quot; Human:&quot;,&quot; AI:&quot;}};</div><div>fetchCompletions = invokeurl</div><div>[</div><div>url :&quot;https://api.openai.com/v1/completions&quot;</div><div>type :POST</div><div>parameters:params.toString()</div><div>detailed : true</div><div>headers:header</div><div>];</div><div>if(fetchCompletions.get(&quot;responseCode&quot;) == 200)</div><div>{</div><div>answer = fetchCompletions.get(&quot;responseText&quot;).get(&quot;choices&quot;).getJSON(&quot;text&quot;);</div><div>info &quot;answer&quot; + answer;</div><div>response.put(&quot;text&quot;,answer);</div><div>}</div><div>else if(fetchCompletions.get(&quot;responseCode&quot;) == 429)</div><div>{</div><div>&nbsp;response = {&quot;text&quot;:&quot;<span style="color:inherit;">I can't help with this. Try asking something else.</span>&quot;};</div><div>}</div><div>}</div><div>}</div><div>return response ;</div></div></div></div></div></div>
</div></div></div></div></div></div></div> ]]></content:encoded><pubDate>Sat, 25 Feb 2023 11:39:34 -0800</pubDate></item><item><title><![CDATA[Create a ChatGPT Slash Command in Zoho Cliq]]></title><link>https://www.blungo.com/blogs/post/Create-a-ChatGPT-Slash-Command-in-Zoho-Cliq</link><description><![CDATA[<img align="left" hspace="5" src="https://www.blungo.com/Blogpost/Thumbnails/Create a chatgpt slash command.png"/>In this tutorial, we are going to go over how to create a slash command in Zoho Cliq, so you can ask questions to ChatGPT directly in Cliq.]]></description><content:encoded><![CDATA[<div class="zpcontent-container blogpost-container "><div data-element-id="elm_8IviC7roTWy1pB8T5m2pag" data-element-type="section" class="zpsection "><style type="text/css"></style><div class="zpcontainer-fluid zpcontainer"><div data-element-id="elm_QTBrCAUDSOyFRlCdpLN1GQ" data-element-type="row" class="zprow zprow-container zpalign-items- zpjustify-content- " data-equal-column=""><style type="text/css"> [data-element-id="elm_QTBrCAUDSOyFRlCdpLN1GQ"].zprow{ border-radius:1px; } </style><div data-element-id="elm_VoIP_gLFRbaPD-J1OwS1cA" data-element-type="column" class="zpelem-col zpcol-12 zpcol-md-12 zpcol-sm-12 zpalign-self- "><style type="text/css"> [data-element-id="elm_VoIP_gLFRbaPD-J1OwS1cA"].zpelem-col{ border-radius:1px; } </style><div data-element-id="elm_Au-KS9B2rZO9fZBiSL1FKw" data-element-type="iframe" class="zpelement zpelem-iframe "><style type="text/css"> [data-element-id="elm_Au-KS9B2rZO9fZBiSL1FKw"].zpelem-iframe{ border-radius:1px; } </style><div class="zpiframe-container zpiframe-align-center"><iframe class="zpiframe " src="https://www.youtube.com/embed/Ctft87QFdNc" width="560" height="315" align="center" allowfullscreen frameBorder="0"></iframe></div>
</div><div data-element-id="elm__bttFMMbQBeQgsOADxw2gg" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm__bttFMMbQBeQgsOADxw2gg"].zpelem-heading { border-radius:1px; } </style><h2
 class="zpheading zpheading-align-left " data-editor="true">What we are going to do</h2></div>
<div data-element-id="elm_FZnVjR5LTqSOKJv9JmBOGQ" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_FZnVjR5LTqSOKJv9JmBOGQ"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><p>In this tutorial we are going to go over how to create a slash command in Zoho Cliq, so you can ask questions to ChatGPT directly in Cliq. Once you get the answer, you will be able to post them on any chat or channel.&nbsp;<span style="color:inherit;">We are going to use the ChatGPT-3 API, that is not the latest version. The ChatGPT-4 API is not available at the time of creating this tutorial. Once the newer API version is available, we will edit this article.</span></p></div>
</div><div data-element-id="elm_DiNwxandSxP56pZ4iGSklA" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_DiNwxandSxP56pZ4iGSklA"].zpelem-heading { border-radius:1px; } </style><h2
 class="zpheading zpheading-align-left " data-editor="true">Pre-requisites</h2></div>
<div data-element-id="elm_Xxk_NPeah5V5w4v05pp0BQ" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_Xxk_NPeah5V5w4v05pp0BQ"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><ul><li>An OpenAI account.</li></ul></div>
</div><div data-element-id="elm_qQGrfB2Sl8Sn6lgzL7Je6w" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_qQGrfB2Sl8Sn6lgzL7Je6w"].zpelem-heading { border-radius:1px; } </style><h2
 class="zpheading zpheading-align-left " data-editor="true">Creating the Command</h2></div>
<div data-element-id="elm_TFRPDqt8lz3vXWSnA1aVhQ" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_TFRPDqt8lz3vXWSnA1aVhQ"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><ol><li>In Zoho Cliq, click on your profile picture, and go to &quot;Bots &amp; Tools&quot;.</li><li>On the left, click on &quot;Commands&quot;</li><li>Click on the &quot;Create Command&quot; button</li><li>Name the command: for this example we are going to name it &quot;chatgpt&quot;</li><li>Add a Hint: for example, ChatGPT answers your questions.</li><li>Choose the access level: we are going to choose &quot;organization&quot;</li><li>Optional: add an image</li><li>Click on &quot;Save &amp; Edit Code&quot;</li></ol></div>
</div><div data-element-id="elm_KeLLX98_CvputMb1INmu8A" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_KeLLX98_CvputMb1INmu8A"].zpelem-heading { border-radius:1px; } </style><h2
 class="zpheading zpheading-align-left " data-editor="true">Editing the Code</h2></div>
<div data-element-id="elm_HgKHqzMlyLRFf0srvnx6Kg" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_HgKHqzMlyLRFf0srvnx6Kg"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><div><span style="text-decoration-line:underline;">On the Execution Handler tab:</span></div><ol><li>Delete the code that is already there.<br></li><li>Copy the code below.</li><li>Paste the code in the &quot;Execution Handler&quot; tab.</li><li>In OpenAI account, go to the settings and click on the &quot;API Keys&quot; tab (or use <a href="https://platform.openai.com/account/api-keys" title="this link" rel="">this link</a>).<br></li><li>Generate a new secret key and copy it.</li><li>Back in Zoho Cliq, replace the key &quot;XXXXXXXXXXXX&quot; with the one you generated.<br></li><li>Cliq on Save.</li></ol><div><br></div><div><span style="text-decoration-line:underline;">On the Suggestion Handler tab:</span></div><div><ol><li>Remove the code.</li><li>Click on Save</li></ol></div></div>
</div><div data-element-id="elm_1jctI-J1lJnhrIE6XeStEw" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_1jctI-J1lJnhrIE6XeStEw"].zpelem-heading { border-radius:1px; } </style><h2
 class="zpheading zpheading-align-left " data-editor="true">Testing the Command</h2></div>
<div data-element-id="elm_75pcWOdATZDgq5ZJJ-cggg" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_75pcWOdATZDgq5ZJJ-cggg"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><ol><li>Open a chat or channel in Zoho Cliq</li><li>Tipe <span style="background-color:rgb(178, 234, 121);">/chatgpt</span> and press Enter</li><li>The first time you use the Command, you will have to allow the Command to access certain information. Click on &quot;Proceed to Allow&quot;.</li><li>Type a prompt. For example, &quot;what is Zoho Cliq?&quot;.</li><li>Press enter to send the message.</li><li>The Command responded to you. The message is visible to you only.</li><li>Use one of the options for the message: post it on the chat, forward it to other chats or channels, or close it. If you don't choose any of the options, when you close the chat, the message will be closed automatically.</li></ol></div>
</div><div data-element-id="elm_XuwatqdttEC16RHlDDYOcQ" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_XuwatqdttEC16RHlDDYOcQ"].zpelem-heading { border-radius:1px; } </style><h2
 class="zpheading zpheading-align-left " data-editor="true">Code</h2></div>
<div data-element-id="elm_ciq0YZMJ43EG0UdZ9rjivg" data-element-type="box" class="zpelem-box zpelement zpbox-container zpdefault-section zpdefault-section-bg "><style type="text/css"> [data-element-id="elm_ciq0YZMJ43EG0UdZ9rjivg"].zpelem-box{ background-color:#B2EA79; background-image:unset; border-style:solid; border-color:#04EA04 !important; border-width:1px; border-radius:5px; padding:20px; } </style><div data-element-id="elm_KmFzfv5GP7K1sB8gq6TcFg" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_KmFzfv5GP7K1sB8gq6TcFg"].zpelem-text { border-radius:1px; padding:0px; margin:0px; } </style><div class="zptext zptext-align-left " data-editor="true"><div><div><div><div style="color:inherit;"><div>response = Map();</div><div>// Creating the card</div><div>card = Map();</div><div>card.put(&quot;theme&quot;,&quot;modern-inline&quot;);</div><div>card.put(&quot;title&quot;,&quot;ChatGTP&quot;);</div><div>// Add Open AI token</div><div>token = &quot;Bearer XXXXXXXXXXXX&quot;;</div><div>//</div><div>header = Map();</div><div>header.put(&quot;Authorization&quot;,token);</div><div>header.put(&quot;Content-Type&quot;,&quot;application/json&quot;);</div><div>params = {&quot;model&quot;:&quot;text-davinci-003&quot;,&quot;prompt&quot;:arguments,&quot;temperature&quot;:0.4,&quot;top_p&quot;:1,&quot;max_tokens&quot;:256,&quot;frequency_penalty&quot;:0,&quot;presence_penalty&quot;:0,&quot;stop&quot;:{&quot; Human:&quot;,&quot; AI:&quot;}};</div><div>fetchCompletions = invokeurl</div><div>[</div><div>url :&quot;https://api.openai.com/v1/completions&quot;</div><div>type :POST</div><div>parameters:params.toString()</div><div>headers:header</div><div>detailed:true</div><div>];</div><div>info &quot;Fetch completions: &quot; + fetchCompletions;</div><div>if(fetchCompletions.get(&quot;responseCode&quot;) == 200)</div><div>{</div><div>answer = fetchCompletions.get(&quot;responseText&quot;).get(&quot;choices&quot;).getJSON(&quot;text&quot;);</div><div>response.put(&quot;text&quot;,answer);</div><div>}</div><div>else if(fetchCompletions.get(&quot;responseCode&quot;) == 429)</div><div>{</div><div>response = {&quot;text&quot;:&quot;Oops! I can't help with this. Try asking something else :wink:&quot;};</div><div>}</div><div>// Adding response to the card</div><div>response.put(&quot;card&quot;,card);</div><div>//</div><div>return response;</div></div></div></div></div></div>
</div></div></div></div></div></div></div> ]]></content:encoded><pubDate>Sat, 25 Feb 2023 11:03:58 -0800</pubDate></item><item><title><![CDATA[Zoho CRM: Execute Function with a Button]]></title><link>https://www.blungo.com/blogs/post/zoho-crm-execute-function-with-a-button</link><description><![CDATA[In this tutorial we are going to create a button that will trigger a function after we select some records. You can trigger any function you want, but ]]></description><content:encoded><![CDATA[<div class="zpcontent-container blogpost-container "><div data-element-id="elm_TtU0TENxTeG-8VJMZKTgPw" data-element-type="section" class="zpsection "><style type="text/css"></style><div class="zpcontainer-fluid zpcontainer"><div data-element-id="elm_08smufW4TguER_xF20H4jA" data-element-type="row" class="zprow zprow-container zpalign-items- zpjustify-content- " data-equal-column=""><style type="text/css"> [data-element-id="elm_08smufW4TguER_xF20H4jA"].zprow{ border-radius:1px; } </style><div data-element-id="elm_aDRteiiQQcifmwXpcREWNg" data-element-type="column" class="zpelem-col zpcol-12 zpcol-md-12 zpcol-sm-12 zpalign-self- "><style type="text/css"> [data-element-id="elm_aDRteiiQQcifmwXpcREWNg"].zpelem-col{ border-radius:1px; } </style><div data-element-id="elm_oK-C9QwaTtHI7jdSOYeqSA" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_oK-C9QwaTtHI7jdSOYeqSA"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><p>In this tutorial we are going to create a button that will trigger a function after we select some records. You can trigger any function you want, but for this example we are going to keep things simple. The button will trigger a function that updates a field.<br></p></div>
</div><div data-element-id="elm_B-UuhmLNPQchcpQVaFx2uQ" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_B-UuhmLNPQchcpQVaFx2uQ"].zpelem-heading { border-radius:1px; } </style><h3
 class="zpheading zpheading-style-none zpheading-align-left " data-editor="true">Part 1: Creating the function</h3></div>
<div data-element-id="elm_CUhldDoto_pJXOkxeijcfg" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_CUhldDoto_pJXOkxeijcfg"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><ol><li>In the set up page, click on &quot;functions&quot; under &quot;developer space&quot;</li><li>Click on the &quot;new function&quot; button</li><li>Name the function and select <span style="text-decoration-line:underline;">Button</span> as the category</li><li>Copy the code down below and paste it in the function's body</li><li>Highlighted in <span style="background-color:rgb(244, 244, 78);">yellow</span> you will find the part of the function you can replace with your own function.</li><li>Now click on &quot;Edit Arguments&quot; and map the argument &quot;<span style="background-color:rgb(161, 203, 232);">id</span>&quot; as a &quot;string&quot;</li><ol><li>If you added your own function that has variables, map them in the arguments section as well</li></ol><li>Finally save the arguments and save the function</li></ol></div>
</div><div data-element-id="elm_zba70tKP6baRtVIXWv5QtQ" data-element-type="box" class="zpelem-box zpelement zpbox-container zpdefault-section zpdefault-section-bg "><style type="text/css"> [data-element-id="elm_zba70tKP6baRtVIXWv5QtQ"].zpelem-box{ background-color:#A1E8C4; background-image:unset; border-style:solid; border-color:#04EA77 !important; border-width:2px; border-radius:15px; margin:20px; } </style><div data-element-id="elm_blWso7AeVA4bx8FAKD_mbg" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_blWso7AeVA4bx8FAKD_mbg"].zpelem-text { border-radius:1px; margin:20px; } </style><div class="zptext zptext-align-left " data-editor="true"><div style="color:inherit;"><div style="color:inherit;"><div>idList = <span style="background-color:rgb(161, 203, 232);">id</span>.toList(&quot;|||&quot;);</div><div>for each id in idList</div><div>{</div><div><div style="color:inherit;"><div><span style="background-color:rgb(244, 244, 78);">currentDate = today;</span></div><div><span style="background-color:rgb(244, 244, 78);">update = zoho.crm.updateRecord(&quot;Deals&quot;,id,{&quot;Contract_signed&quot;:currentDate});</span></div></div></div><div>}</div><div>return &quot;Contract signed date updated&quot;;</div></div></div></div>
</div></div><div data-element-id="elm_F04y-09OZllB9eFE3uMz3w" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_F04y-09OZllB9eFE3uMz3w"].zpelem-heading { border-radius:1px; } </style><h3
 class="zpheading zpheading-style-none zpheading-align-left " data-editor="true">Part 2: Creating the button</h3></div>
<div data-element-id="elm_A83fbC-Czpy9FvVPRANHbQ" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_A83fbC-Czpy9FvVPRANHbQ"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><ol><li>In the setup page, go to &quot;Modules and fields&quot; under &quot;Customization&quot;</li><li>Open the module that you are creating the function for. In my case it's the Deals module</li><li>On the top, click on &quot;Links and Buttons&quot;</li><li>Click on &quot;New Button&quot;</li><li>Name the button and add a description if you would like to</li><li>Select &quot;List View - Mass Action Menu&quot; as the place were the button is going to be located</li><li>The action to perform is &quot;From Existing Actions&quot; under &quot;Functions&quot;</li><li>Now click on &quot;Configure&quot; next to the function you just created</li><li>Map the &quot;id&quot; parameter to the Deal Id field, pressing #</li><li>Save everything and test the button</li></ol></div>
</div></div></div></div></div></div> ]]></content:encoded><pubDate>Thu, 25 Nov 2021 10:07:04 -0800</pubDate></item><item><title><![CDATA[Function: Count Related Records in Zoho CRM]]></title><link>https://www.blungo.com/blogs/post/function-count-related-records-in-zoho-crm</link><description><![CDATA[In this tutorial we are going to create a function that will count the related record of a record, and will add the total count to a field that you ca ]]></description><content:encoded><![CDATA[<div class="zpcontent-container blogpost-container "><div data-element-id="elm_TtU0TENxTeG-8VJMZKTgPw" data-element-type="section" class="zpsection "><style type="text/css"></style><div class="zpcontainer-fluid zpcontainer"><div data-element-id="elm_08smufW4TguER_xF20H4jA" data-element-type="row" class="zprow zprow-container zpalign-items- zpjustify-content- " data-equal-column=""><style type="text/css"> [data-element-id="elm_08smufW4TguER_xF20H4jA"].zprow{ border-radius:1px; } </style><div data-element-id="elm_aDRteiiQQcifmwXpcREWNg" data-element-type="column" class="zpelem-col zpcol-12 zpcol-md-12 zpcol-sm-12 zpalign-self- "><style type="text/css"> [data-element-id="elm_aDRteiiQQcifmwXpcREWNg"].zpelem-col{ border-radius:1px; } </style><div data-element-id="elm_oK-C9QwaTtHI7jdSOYeqSA" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_oK-C9QwaTtHI7jdSOYeqSA"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><p>In this tutorial we are going to create a function that will count the related record of a record, and will add the total count to a field that you can use to filter your records or trigger other automations. For this example, we will count how many Deals are related to a Contact, but you can replace the variables to count other related records, even if they are part of a custom module.<br></p><p><br>This function will trigger when a new Deal is created. So when you create a new Deal, it will find the contact related to that Deal, and it will count how many Deals the Contact has, and then it will place the total number in a field in the Contact.</p><p><br></p><p>If you would like to run this function on all the records you currently have, without having to wait for a related record to be created, you will have to create a different function that will update all the records at once. This tutorial doesn't show how to do that.</p></div>
</div><div data-element-id="elm_N91jtSW8b7btidnA7vJ3EA" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_N91jtSW8b7btidnA7vJ3EA"].zpelem-heading { border-radius:1px; } </style><h3
 class="zpheading zpheading-style-none zpheading-align-left " data-editor="true"><span style="color:inherit;"><p>Part 1: Add a field to the Contacts layout</p></span></h3></div>
<div data-element-id="elm_eD65lYRAak449YcvKkgoVA" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_eD65lYRAak449YcvKkgoVA"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><ol><li>In CRM, open the set up page, then go to modules and fields under customization</li><li>Open your deals module, in my case it's called opportunities</li><li>Open the layout you want to edit</li><li>Add a user field and name it</li><li>Save and close the module</li><li>Then, on the setup, go to developer space and click on APIs</li><li>On the top, go to APIs names and open &quot;Deals&quot;</li><li>On the list, find the field you just created, and take note of the API name</li></ol><p><br></p></div>
</div><div data-element-id="elm_B-UuhmLNPQchcpQVaFx2uQ" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_B-UuhmLNPQchcpQVaFx2uQ"].zpelem-heading { border-radius:1px; } </style><h3
 class="zpheading zpheading-style-none zpheading-align-left " data-editor="true">Part 2: Creating the function</h3></div>
<div data-element-id="elm_CUhldDoto_pJXOkxeijcfg" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_CUhldDoto_pJXOkxeijcfg"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><ol><li>In the set up, click on &quot;functions&quot; under &quot;developer space&quot;</li><li>Click on the &quot;new function&quot; button</li><li>Name the function and select automation as the category</li><li>Copy the code down below and paste it in the function's body</li><li>Replace &quot;<span style="background-color:rgb(178, 234, 121);">API_name_field</span>&quot; for the API name that you found on step one (where you want to place the total count number)</li><li>Find the API name of the module that you would like to count, in my case it's Deals</li><li>Replace &quot;<span style="background-color:rgb(234, 234, 4);">API_name_to_count</span>&quot; with the API name found (Deals)</li><li><div style="color:inherit;"><div>Find the API name of the main module, in my case it's Contacts</div></div></li><li><div><span style="color:inherit;">Replace &quot;<span style="background-color:rgb(243, 156, 18);">API_name_record</span>&quot; with the API name found (Contacts)</span></div></li><li>Now click on &quot;Edit Arguments&quot; and map the argument &quot;<span style="background-color:rgb(161, 203, 232);">contactId</span>&quot; as a &quot;string&quot; (you can change the name of this argument if the main module is different; ie: if you are counting products related to a deal, the main module will be Deal, so you can call this field &quot;DEALID&quot;)</li><li>Finally save the arguments and save the function</li></ol></div>
</div><div data-element-id="elm_zba70tKP6baRtVIXWv5QtQ" data-element-type="box" class="zpelem-box zpelement zpbox-container zpdefault-section zpdefault-section-bg "><style type="text/css"> [data-element-id="elm_zba70tKP6baRtVIXWv5QtQ"].zpelem-box{ background-color:#A1E8C4; background-image:unset; border-style:solid; border-color:#04EA77 !important; border-width:2px; border-radius:15px; margin:20px; } </style><div data-element-id="elm_blWso7AeVA4bx8FAKD_mbg" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_blWso7AeVA4bx8FAKD_mbg"].zpelem-text { border-radius:1px; margin:20px; } </style><div class="zptext zptext-align-left " data-editor="true"><div style="color:inherit;"><div>relRecords = zoho.crm.getRelatedRecords(&quot;<span style="background-color:rgb(234, 234, 4);">API_name_to_count</span>&quot;,&quot;<span style="background-color:rgb(243, 156, 18);">API_name_record</span>&quot;,<span style="background-color:rgb(161, 203, 232);">contactId</span>.toLong());</div><div>mp = Map();</div><div>mp.put(&quot;<span style="background-color:rgb(178, 234, 121);">API_name_field</span>&quot;,relRecords.size().toString());</div><div>updateResp = zoho.crm.updateRecord(&quot;<span style="color:inherit;background-color:rgb(243, 156, 18);">API_name_record</span>&quot;,<span style="background-color:rgb(161, 203, 232);">contactId</span>.toLong(),mp);</div><div>info updateResp;</div></div></div>
</div></div><div data-element-id="elm_F04y-09OZllB9eFE3uMz3w" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_F04y-09OZllB9eFE3uMz3w"].zpelem-heading { border-radius:1px; } </style><h3
 class="zpheading zpheading-style-none zpheading-align-left " data-editor="true">Part 3: Creating the workflow</h3></div>
<div data-element-id="elm_A83fbC-Czpy9FvVPRANHbQ" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_A83fbC-Czpy9FvVPRANHbQ"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><ol><li>In the setup page, click on workflow rules under automations</li><li>Create a new rule, select the Deals module, and name it (we are selecting the Deals instead of the contact because we need to trigger this automation when a Deal is created; you have to select the module that you are counting)</li><li>Configure your workflow trigger and conditions:</li><ol><li>When &gt; on a record action &gt; at creation</li><li>Condition: all Deals</li></ol><li>As the instant action, select &quot;function&quot;</li><li>Click on &quot;new function&quot; and then select &quot;functions&quot;</li><li>Find the function you just created, and click on &quot;configure&quot;</li><li>Map the argument &quot;potId&quot; as the deal ID, using the # key</li><li>Click on &quot;save and associate&quot; and save the workflow</li><li>Test the workflow</li></ol></div>
</div></div></div></div></div></div> ]]></content:encoded><pubDate>Thu, 18 Nov 2021 11:34:13 -0800</pubDate></item><item><title><![CDATA[Automatically create a project when deal is won (Zoho Projects and CRM)]]></title><link>https://www.blungo.com/blogs/post/Automatically-create-a-Zoho-Project-when-deal-is-won-in-Zoho-CRM</link><description><![CDATA[In this tutorial we are going to set up a workflow and a function that will create a project in Zoho Project, after a deal was modified in Zoho CRM. W ]]></description><content:encoded><![CDATA[<div class="zpcontent-container blogpost-container "><div data-element-id="elm_TtU0TENxTeG-8VJMZKTgPw" data-element-type="section" class="zpsection "><style type="text/css"></style><div class="zpcontainer-fluid zpcontainer"><div data-element-id="elm_08smufW4TguER_xF20H4jA" data-element-type="row" class="zprow zprow-container zpalign-items- zpjustify-content- " data-equal-column=""><style type="text/css"> [data-element-id="elm_08smufW4TguER_xF20H4jA"].zprow{ border-radius:1px; } </style><div data-element-id="elm_aDRteiiQQcifmwXpcREWNg" data-element-type="column" class="zpelem-col zpcol-12 zpcol-md-12 zpcol-sm-12 zpalign-self- "><style type="text/css"> [data-element-id="elm_aDRteiiQQcifmwXpcREWNg"].zpelem-col{ border-radius:1px; } </style><div data-element-id="elm_KuXYhVEqjljoEFMIckCChA" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_KuXYhVEqjljoEFMIckCChA"].zpelem-heading { border-radius:1px; } </style><h3
 class="zpheading zpheading-style-none zpheading-align-left " data-editor="true">How it works</h3></div>
<div data-element-id="elm_keZ0bLXAQqWCZIR6M9LlDA" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_keZ0bLXAQqWCZIR6M9LlDA"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><p style="text-align:left;">In this tutorial we are going to set up a workflow and a function that will create a project in Zoho Project, after a deal was modified in Zoho CRM. When a user makes specific changes in Zoho CRM, like updating the deal stage, this will trigger a workflow that will call a function, and this function will create the project, as well as transferring information from the deal.</p></div>
</div><div data-element-id="elm_koFmoffNMMiOR7lfT4qupw" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_koFmoffNMMiOR7lfT4qupw"].zpelem-heading { border-radius:1px; } </style><h3
 class="zpheading zpheading-style-none zpheading-align-left " data-editor="true">Pre-requisites</h3></div>
<div data-element-id="elm_H-ryoygftDyZ8H9mU0rPtA" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_H-ryoygftDyZ8H9mU0rPtA"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><ul><li style="text-align:left;">The deals layout has to be ready, with all fields matching the ones in Zoho Projects. Video:&nbsp;<a href="https://youtu.be/UK_MpUnYWvg">https://youtu.be/UK_MpUnYWvg</a></li><li style="text-align:left;">The project layout has to be ready as well, matching Zoho CRM fields. Video:&nbsp;<a href="https://youtu.be/Dy6K_fwARGw?t=14">https://youtu.be/Dy6K_fwARGw?t=14</a></li><li style="text-align:left;">A template in Zoho Projects has to be created. Video:&nbsp;<a href="https://youtu.be/Dy6K_fwARGw?t=126">https://youtu.be/Dy6K_fwARGw?t=126</a></li></ul></div>
</div><div data-element-id="elm_8pEZ4tCbomOsRT_x7dgTQA" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_8pEZ4tCbomOsRT_x7dgTQA"].zpelem-heading { border-radius:1px; } </style><h3
 class="zpheading zpheading-style-none zpheading-align-left " data-editor="true">Optional</h3></div>
<div data-element-id="elm_7iSy70Puoc8nCTzt8Hnamw" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_7iSy70Puoc8nCTzt8Hnamw"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><p>This automation will <span style="font-weight:700;">NOT</span> work if the account field on the Deal is empty. You can manually assign an Account, before wining the Deal, or you can create a workflow to do it. If you choose to create a workflow, here are the steps:&nbsp;<a href="https://www.blungo.com/blogs/post/workflow-assign-account-to-a-deal-automatically-zoho-crm">https://www.blungo.com/blogs/post/workflow-assign-account-to-a-deal-automatically-zoho-crm</a><br></p></div>
</div><div data-element-id="elm_fY9G8YpKEL6qdrpxUBSiuQ" data-element-type="divider" class="zpelement zpelem-divider "><style type="text/css"> [data-element-id="elm_fY9G8YpKEL6qdrpxUBSiuQ"].zpelem-divider{ border-radius:1px; } </style><style></style><div class="zpdivider-container zpdivider-line zpdivider-align-center zpdivider-width100 zpdivider-line-style-solid "><div class="zpdivider-common"></div>
</div></div><div data-element-id="elm_N91jtSW8b7btidnA7vJ3EA" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_N91jtSW8b7btidnA7vJ3EA"].zpelem-heading { border-radius:1px; } </style><h1
 class="zpheading zpheading-style-none zpheading-align-left " data-editor="true">Creating the automation</h1></div>
<div data-element-id="elm_R9X6qYm0Syg1cX7j_kHJdQ" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_R9X6qYm0Syg1cX7j_kHJdQ"].zpelem-heading { border-radius:1px; } </style><h3
 class="zpheading zpheading-style-none zpheading-align-left " data-editor="true"><span style="text-decoration-line:underline;">Part 1</span>: Adding a new connection</h3></div>
<div data-element-id="elm_eD65lYRAak449YcvKkgoVA" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_eD65lYRAak449YcvKkgoVA"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><ol><li>In CRM, go to developer space and the to connections</li><li>Click on Add new connection, and select ZohoOAuth</li><li>Connection name: relateproject</li><li>Connection Link name: relateproject</li><li>Scope: choose these two variables: ZohoCRM.modules.ALL, ZohoProjects.projects.ALL, and ZohoProjects.projects.CREATE</li><li>Click on &quot;create and connect&quot;, and when a new window pops up, click on &quot;accept&quot;</li></ol></div>
</div><div data-element-id="elm_K6YbHvj5Ji0BZyBBbJzIEw" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_K6YbHvj5Ji0BZyBBbJzIEw"].zpelem-heading { border-radius:1px; } </style><h3
 class="zpheading zpheading-style-none zpheading-align-left " data-editor="true"><span style="text-decoration-line:underline;">Part 2</span>: Adding a new function</h3></div>
<div data-element-id="elm_AnwD2u1czuApupRLez7ogA" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_AnwD2u1czuApupRLez7ogA"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><ol><li>In the CRM, go to developers and then functions, and add a new function</li><li>Name it &quot;Create Project&quot; and select automation as the category</li><li>Copy the function listed below and paste in the function window</li><li>Click on &quot;edit arguments&quot;, and map the the arguments as shown in the image below the function</li><ul><li>You need to map: <span style="font-weight:700;">ProjName</span>, <span style="font-weight:700;">Description</span>, <span style="font-weight:700;">TemplateID</span>, <span style="font-weight:700;">PortalName</span>&nbsp;as <span style="font-style:italic;">string</span>&nbsp;and <span style="font-weight:700;">id</span> as <span style="font-style:italic;">int</span><br></li></ul></ol></div>
</div><div data-element-id="elm_0cpLipvMHrJS6XRBiyu66Q" data-element-type="box" class="zpelem-box zpelement zpbox-container zpdefault-section zpdefault-section-bg "><style type="text/css"> [data-element-id="elm_0cpLipvMHrJS6XRBiyu66Q"].zpelem-box{ background-color:#A1E8C4; background-image:unset; border-style:solid; border-color:#04EA77 !important; border-width:2px; border-radius:15px; margin:20px; } </style><div data-element-id="elm_KC6bEj1E5cl9KFRHmFexOA" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_KC6bEj1E5cl9KFRHmFexOA"].zpelem-text { border-radius:1px; margin:20px; } </style><div class="zptext zptext-align-left " data-editor="true"><span style="color:inherit;"><div>createMap = Map();</div><div>createMap.put(&quot;name&quot;,ProjName);</div><div>createMap.put(&quot;description&quot;,Description);</div><div>createMap.put(&quot;template_id&quot;,TemplateID);</div><div>//custom fields</div><div>//end of custom fields</div><div>response = zoho.projects.createProject(PortalName,createMap,&quot;relateproject&quot;);</div><div>info response;</div><div>mp = Map();</div><div>mp.put(&quot;name&quot;,ProjName);</div><div>datalist = List();</div><div>datalist.add(mp);</div><div>datamp = Map();</div><div>datamp.put(&quot;data&quot;,datalist);</div><div>resp2 = invokeurl</div><div>[</div><div>url :&quot;https://www.zohoapis.com/crm/v2/Deals/&quot; + id + &quot;/Zoho_Projects/&quot; + response.getJSON(&quot;projects&quot;).getJSON(&quot;id&quot;)</div><div>type :POST</div><div>parameters:datamp.toString()</div><div>connection:&quot;relateproject&quot;</div><div>];</div><div>info resp2;</div></span></div>
</div></div><div data-element-id="elm_b5VpCfBYOzkq-a5Zv5SoZQ" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_b5VpCfBYOzkq-a5Zv5SoZQ"].zpelem-heading { border-radius:1px; } </style><h3
 class="zpheading zpheading-style-none zpheading-align-left " data-editor="true"><span style="text-decoration-line:underline;">Part 3</span>: Testing the function</h3></div>
<div data-element-id="elm_-2l-5tpvRh69vNeFcPNB1w" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_-2l-5tpvRh69vNeFcPNB1w"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><ol><li>Click on &quot;save and execute&quot;</li><li>In the new dialog, add your parameters:</li><ol><li><span style="font-weight:700;">ProjName</span>: Any name you want for the project<br></li><li><span style="font-weight:700;">Description</span>: Any description<br></li><li><span style="font-weight:700;">TemplateID</span>: Open the Zoho Projects template and copy the ID from the URL (ie:&nbsp;https://projects.zoho.com/portal/blungo#todomilestones/<span style="background-color:rgb(244, 244, 78);">1600615000000748888</span>/)<br></li><li><span style="font-weight:700;">PortalName</span>: Open Zoho Projects and find it in the URL (ie:&nbsp;https://projects.zoho.com/portal/<span style="background-color:rgb(244, 244, 78);">blungo</span>#todomilestones/1600615000000748888/)<br></li><li><span style="font-weight:700;">id</span>: Open a Deal in CRM and copy the Deal ID from the URL<br></li></ol><li>Click on save</li></ol></div>
</div><div data-element-id="elm_8lmihYZMt7RJLZf8R4Xr4w" data-element-type="box" class="zpelem-box zpelement zpbox-container zpdefault-section zpdefault-section-bg "><style type="text/css"> [data-element-id="elm_8lmihYZMt7RJLZf8R4Xr4w"].zpelem-box{ background-color:#CEE4F3; background-image:unset; border-style:solid; border-color:#A1CBE8 !important; border-width:2px; border-radius:15px; margin:20px; } </style><div data-element-id="elm_uX0iGrYMwIp8Sx6tpsQ85g" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_uX0iGrYMwIp8Sx6tpsQ85g"].zpelem-text { border-radius:1px; margin:20px; } </style><div class="zptext zptext-align-left " data-editor="true"><span style="color:inherit;"><div>If everything went well, you will get a long dialog box on the right, and at the end it will say that the function was successfully executed. If you get any errors, even if the function was successfully executed, you must have missed a step. Please remember that the Deal you are using to test this out has to have an Account related.</div></span></div>
</div></div><div data-element-id="elm_iu0r3x862lUUpoXvu400Gg" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_iu0r3x862lUUpoXvu400Gg"].zpelem-heading { border-radius:1px; } </style><h3
 class="zpheading zpheading-style-none zpheading-align-left " data-editor="true"><span style="text-decoration-line:underline;">Part 4</span>: Adding custom fields</h3></div>
<div data-element-id="elm_eiJNgUxXu9ojRTvxHBzBSg" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_eiJNgUxXu9ojRTvxHBzBSg"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><p>To find custom fields API names from Zoho Projects, please follow this tutorial: LINK</p><p>You can reuse the connection you already created earlier on, or you can create a new connection.</p></div>
</div><div data-element-id="elm_riaA2G-g52Kq8XCZBar0Bw" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_riaA2G-g52Kq8XCZBar0Bw"].zpelem-heading { border-radius:1px; } </style><h4
 class="zpheading zpheading-style-none zpheading-align-left " data-editor="true"><span style="color:inherit;">A) Once you have the custom field API names:</span></h4></div>
<div data-element-id="elm_FhxWkSgUWX6PwmozxF0nSg" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_FhxWkSgUWX6PwmozxF0nSg"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><ol><li>Right after &quot;//custom fields&quot;, paste the following function:<br></li><ul><li><span style="color:inherit;background-color:rgb(161, 232, 196);">createMap.put(&quot;ZOHO_PROJECT_FIELD_API&quot;,CRM_FIELD_API);</span></li></ul><li>Replace &quot;<span style="color:inherit;"><span style="font-weight:700;">ZOHO_PROJECT_FIELD_API</span>&quot; with the Zoho Project Field API name of the field you want to map</span><br></li><li><span style="color:inherit;">In the CRM setup, go to &quot;developer space&quot; and the to &quot;APIs&quot;</span></li><ol><li><span style="color:inherit;">Click on &quot;APIs names&quot;, and then click on Deals</span></li><li><span style="color:inherit;">Find the field that you want to map, and copy the API name</span></li></ol><li>Go back to the function, and replace &quot;<span style="font-weight:700;">CRM_FIELD_API</span>&quot; with the API name you just found<br></li><li>Repeat the same steps for as many fields as you want to map</li></ol></div>
</div><div data-element-id="elm_9r9iQx5E9UbVCZlN3gRKhQ" data-element-type="box" class="zpelem-box zpelement zpbox-container zpdefault-section zpdefault-section-bg "><style type="text/css"> [data-element-id="elm_9r9iQx5E9UbVCZlN3gRKhQ"].zpelem-box{ background-color:#CEE4F3; background-image:unset; border-style:solid; border-color:#A1CBE8 !important; border-width:2px; border-radius:15px; margin:20px; } </style><div data-element-id="elm_wefZqpL98pQcUjUBPK9Mqw" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_wefZqpL98pQcUjUBPK9Mqw"].zpelem-text { border-radius:1px; margin:20px; } </style><div class="zptext zptext-align-left " data-editor="true"><span style="color:inherit;"><div>Note: to map a date field, you have to use the following function:</div><div><ul><li><span style="color:inherit;background-color:rgb(161, 232, 196);">createMap.put(&quot;ZOHO_PROJECT_FIELD_API&quot;,CRM_FIELD_API.toString(&quot;MM-dd-yyyy&quot;));</span></li></ul></div></span></div>
</div></div><div data-element-id="elm_RN--6DK1oAYvEywiabGUDg" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_RN--6DK1oAYvEywiabGUDg"].zpelem-heading { border-radius:1px; } </style><h4
 class="zpheading zpheading-style-none zpheading-align-left " data-editor="true"><span style="color:inherit;">B) Map the arguments</span></h4></div>
<div data-element-id="elm_LZDtXnQJZ96hfyMs5TBfHQ" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_LZDtXnQJZ96hfyMs5TBfHQ"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><ol><li>Click on &quot;edit arguments&quot;</li><li>For each field you want to map, add one argument line</li><li>Copy the &quot;CRM API names&quot; and paste them on the lines you added</li><ol><li>ie: createMap.put(&quot;UDF_CHAR1&quot;,<span style="background-color:rgb(244, 244, 78);">Zoho_Drive_Folder</span>);</li></ol><li>Select &quot;string&quot; as type, for all of them</li><li>Click on &quot;save&quot;</li></ol><p><br></p><p>Finally, save the function by clicking on &quot;Save&quot; on the top right corner.</p></div>
</div><div data-element-id="elm_nAwrYUFbPAh0pZZuRMfq8Q" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_nAwrYUFbPAh0pZZuRMfq8Q"].zpelem-heading { border-radius:1px; } </style><h3
 class="zpheading zpheading-style-none zpheading-align-left " data-editor="true"><span style="text-decoration-line:underline;">Part 5</span>: Creating the workflow</h3></div>
<div data-element-id="elm_Nh8X_s2qqOwJE1UWpumzPw" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_Nh8X_s2qqOwJE1UWpumzPw"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><ol><li>Go to the workflows section and create a new one</li><li>Name it and relate it to the deals module</li><li>When: stage is modified</li><li>Condition: stage is Signed (select any stage you want to trigger this workflow)</li><li>Instant Action: Function</li><li>Click on &quot;functions&quot; and select the function &quot;create project&quot;</li><li>Now click on &quot;configure&quot;, and map all the fields (press # for merge field)</li><ol><li><span style="font-weight:700;">PortalName</span>: find it in the ZohoProjects URL (ie:&nbsp;https://projects.zoho.com/portal/<span style="background-color:rgb(244, 244, 78);">blungo</span>#todomilestones/1600615000000748888/)<br></li><li><span style="font-weight:700;">TemplateID</span>: find it in the template URL (ie:&nbsp;https://projects.zoho.com/portal/blungo#todomilestones/<span style="background-color:rgb(244, 244, 78);">160061500000008888</span>/)<br></li><li>The rest of the fields are merge fields from the CRM, including <span style="font-weight:700;">id</span>, which is the Deal ID<br></li></ol><li>Click on &quot;save and associate&quot;</li><li>Finally click on Save</li></ol><div><br></div>
<div><div><span style="font-weight:700;">Now refresh the deal you want to test this automation on and move it to the signed stage. The new project should be created automatically in Zoho Projects, and all the fields from the CRM should be copied to the fields in Projects. Also the project should be linked to the CRM in the projects section.</span></div>
</div><p><br></p></div></div></div></div></div></div></div> ]]></content:encoded><pubDate>Mon, 05 Jul 2021 15:51:00 -0700</pubDate></item><item><title><![CDATA[Workflow: assign Account to a Deal automatically (Zoho CRM)]]></title><link>https://www.blungo.com/blogs/post/workflow-assign-account-to-a-deal-automatically-zoho-crm</link><description><![CDATA[First, create a generic account that can be used for multiple projects (ie: Won Deals) Open the account you just created and copy the account ID (ie: ]]></description><content:encoded><![CDATA[<div class="zpcontent-container blogpost-container "><div data-element-id="elm_TtU0TENxTeG-8VJMZKTgPw" data-element-type="section" class="zpsection "><style type="text/css"></style><div class="zpcontainer-fluid zpcontainer"><div data-element-id="elm_08smufW4TguER_xF20H4jA" data-element-type="row" class="zprow zprow-container zpalign-items- zpjustify-content- " data-equal-column=""><style type="text/css"> [data-element-id="elm_08smufW4TguER_xF20H4jA"].zprow{ border-radius:1px; } </style><div data-element-id="elm_aDRteiiQQcifmwXpcREWNg" data-element-type="column" class="zpelem-col zpcol-12 zpcol-md-12 zpcol-sm-12 zpalign-self- "><style type="text/css"> [data-element-id="elm_aDRteiiQQcifmwXpcREWNg"].zpelem-col{ border-radius:1px; } </style><div data-element-id="elm_nWD3Uii-miQ3oxIfFkJCpQ" data-element-type="video" class="zpelement zpelem-video "><style type="text/css"> [data-element-id="elm_nWD3Uii-miQ3oxIfFkJCpQ"].zpelem-video{ border-radius:1px; } </style><div class="zpvideo-container zpiframe-align-center zpiframe-mobile-align- zpiframe-tablet-align-"><iframe class="zpvideo " width="560" height="315" src="https://www.youtube.com/embed/dqyCDc_KmJs" frameborder="0" allowfullscreen></iframe></div>
</div><div data-element-id="elm_N91jtSW8b7btidnA7vJ3EA" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_N91jtSW8b7btidnA7vJ3EA"].zpelem-heading { border-radius:1px; } </style><h3
 class="zpheading zpheading-style-none zpheading-align-left " data-editor="true">Part 1: Creating a function</h3></div>
<div data-element-id="elm_P3GdjazMij2G5isvI5cFeA" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_P3GdjazMij2G5isvI5cFeA"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><ol><li>First, create a generic account that can be used for multiple projects (ie: Won Deals)</li><li>Open the account you just created and copy the account ID (ie:&nbsp;<span style="background-color:rgb(244, 244, 78);">44341800000037248888</span>)</li><li>In CRM, go to settings, developer space, functions, and add a new function</li><li>Name the function (ie: Update_account_in_deal), and select &quot;automation&quot; as the category</li><li>Paste the following code in the new window, and make sure to replace the account ID number:</li><ul><li><span style="color:inherit;background-color:rgb(161, 232, 196);">update = zoho.crm.updateRecord(&quot;Deals&quot;,potid,{&quot;Account_Name&quot;:</span><span style="color:inherit;background-color:rgb(244, 244, 78);">4434180000003728888</span><span style="color:inherit;background-color:rgb(161, 232, 196);">});</span></li></ul><li>Click on &quot;edit arguments&quot;, and add &quot;potid&quot; as an &quot;int&quot;</li><li>Save everything</li></ol></div>
</div><div data-element-id="elm_G-CNsIoheP0Cmfdca8zp0g" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_G-CNsIoheP0Cmfdca8zp0g"].zpelem-heading { border-radius:1px; } </style><h3
 class="zpheading zpheading-style-none zpheading-align-left " data-editor="true">Part 2: Creating the workflow</h3></div>
<div data-element-id="elm_67vUDfoXwvdvyJqgyddLFw" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_67vUDfoXwvdvyJqgyddLFw"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><ol><li><span style="color:inherit;">Go to Workflow rules and create a new rule related to the Deals module</span></li><li><span style="color:inherit;">Edit the rule:&nbsp;</span></li><ol><li>When stage is modified to any value</li><li><span style="color:inherit;">Condition: Stage is Won</span></li><li><span style="color:inherit;">Action: function, and select the function you just created</span></li><li><span style="color:inherit;">Then map the field &quot;potid&quot; to the Deal ID using the # key</span></li></ol><li><span style="color:inherit;">Save everything</span></li></ol></div>
</div><div data-element-id="elm_zba70tKP6baRtVIXWv5QtQ" data-element-type="box" class="zpelem-box zpelement zpbox-container zpdefault-section zpdefault-section-bg "><style type="text/css"> [data-element-id="elm_zba70tKP6baRtVIXWv5QtQ"].zpelem-box{ background-color:#CEE4F3; background-image:unset; border-style:solid; border-color:#A1CBE8 !important; border-width:2px; border-radius:15px; margin:20px; } </style><div data-element-id="elm_blWso7AeVA4bx8FAKD_mbg" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_blWso7AeVA4bx8FAKD_mbg"].zpelem-text { border-radius:1px; margin:20px; } </style><div class="zptext zptext-align-left " data-editor="true"><div>Note: edit the rule settings (When, Condition) to match your preferences. In this case we are using the Stage as the trigger, but it can be any field in the Deals module.</div></div>
</div></div></div></div></div></div></div> ]]></content:encoded><pubDate>Mon, 05 Jul 2021 12:00:16 -0700</pubDate></item></channel></rss>