<?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/workdrive/feed" rel="self" type="application/rss+xml"/><title>blungo - Blog #workdrive</title><description>blungo - Blog #workdrive</description><link>https://www.blungo.com/blogs/tag/workdrive</link><lastBuildDate>Thu, 09 Oct 2025 03:45:07 -0700</lastBuildDate><generator>http://zoho.com/sites/</generator><item><title><![CDATA[Function: Create a Subfolders in WorkDrive from Zoho CRM]]></title><link>https://www.blungo.com/blogs/post/function-create-a-subfolders-in-workdrive-from-zoho-crm</link><description><![CDATA[<img align="left" hspace="5" src="https://www.blungo.com/Blogpost/Thumbnails/Function create folders and subfolders.png"/>We are going to create a workflow that will trigger a function that creates a set of subfolders inside a Team folder in Zoho WorkDrive. You can use th ]]></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"> [data-element-id="elm_8IviC7roTWy1pB8T5m2pag"].zpsection{ border-radius:1px; } </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_Sb5SNDSydE7qemcHPeDkYA" data-element-type="iframe" class="zpelement zpelem-iframe "><style type="text/css"> [data-element-id="elm_Sb5SNDSydE7qemcHPeDkYA"].zpelem-iframe{ border-radius:1px; } </style><div class="zpiframe-container zpiframe-align-center"><iframe class="zpiframe " src="https://www.youtube.com/embed/7jRuCsR8iyY" 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><span style="color:inherit;"><span style="font-size:12pt;">We are going to create a workflow that will trigger a function that creates a set of subfolders inside a Team folder in Zoho WorkDrive. You can use the function to create folders or subfolders in your personal folder as well. This is continuation of the previous tutorial called &quot;Function: Create a WorkDrive Team Folder and Attach it to the CRM Record&quot;.</span></span><br></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">Important notes</h2></div>
<div data-element-id="elm_hz8PZ4Xcqs0QNEQoK-bF4A" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_hz8PZ4Xcqs0QNEQoK-bF4A"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><ul><li><span style="color:inherit;"><span style="font-size:12pt;">We are going to create normal folders. If you want to create a Team Folder, check out this tutorial: <a href="https://www.blungo.com/blogs/post/function-create-a-workdrive-team-folder-and-attach-it-to-the-crm-record">https://www.blungo.com/blogs/post/function-create-a-workdrive-team-folder-and-attach-it-to-the-crm-record</a>.</span></span></li><li><span style="color:inherit;">This tutorial is Part 2 of the WorkDrive folder creation series. The code will work as long as you already have a WorkDrive Team Folder attached to the Deal. You can modify the code as needed if you are not going to use a Team Folder. The code below includes some examples of different ways to get the folder ID.&nbsp;</span><br></li><li>You have to have full access to Zoho CRM and WorkDrive.</li></ul></div>
</div><div data-element-id="elm_bH9HTWKeMYa0wBOHoFGR9Q" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_bH9HTWKeMYa0wBOHoFGR9Q"].zpelem-heading { border-radius:1px; } </style><h2
 class="zpheading zpheading-align-left " data-editor="true">Creating a connection</h2></div>
<div data-element-id="elm_dXzVsdkCiYi3-R5EpU9GEQ" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_dXzVsdkCiYi3-R5EpU9GEQ"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><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;<span style="background-color:rgb(178, 234, 121);">crm_workdrive</span>&quot;.</li><li>Add the scopes. Use the magnifier to easily find the scopes.</li><ol><li>List of scopes:&nbsp;ZohoCRM.modules.ALL, zohosearch.securesearch.READ, WorkDrive.team.ALL, WorkDrive.workspace.ALL, WorkDrive.files.ALL, WorkDrive.organization.READ, WorkDrive.members.READ, WorkDrive.members.CREATE, WorkDrive.members.UPDATE, WorkDrive.members.DELETE, WorkDrive.teamfolders.CREATE, WorkDrive.teamfolders.READ, WorkDrive.teamfolders.UPDATE, WorkDrive.teamfolders.DELETE, WorkDrive.teamfolders.sharing.CREATE, WorkDrive.teamfolders.sharing.READ, WorkDrive.teamfolders.sharing.UPDATE, WorkDrive.teamfolders.sharing.DELETE, WorkDrive.teamfolders.admin.READ, WorkDrive.groups.CREATE, WorkDrive.groups.READ, WorkDrive.groups.UPDATE, WorkDrive.groups.DELETE, WorkDrive.DataTemplates.CREATE, WorkDrive.DataTemplates.DELETE, WorkDrive.DataTemplates.UPDATE, WorkDrive.links.ALL, WorkDrive.users.READ</li></ol><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><div data-element-id="elm_FaQu2poynxcvsxnK4vLvCQ" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_FaQu2poynxcvsxnK4vLvCQ"].zpelem-heading { border-radius:1px; } </style><h2
 class="zpheading zpheading-align-left " data-editor="true">Setting up the function</h2></div>
<div data-element-id="elm_IYa4I1DOPxWtTnCpxCUwRQ" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_IYa4I1DOPxWtTnCpxCUwRQ"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><ol><li>In the Zoho CRM settings, go to &quot;Functions&quot; under &quot;Developer Space&quot;.</li><li>Create a new function: Add a name and select &quot;Automation&quot; as the category.</li><li>Copy the function located below and paste it in the text editor in Zoho CRM.</li><li>Edit the arguments: add &quot;deal_id&quot; as a string.<br></li><li>Generate your folder structure:</li><ol><li>Rename the folders,</li><li>Add more folders,</li><li>Create subfolders if needed.</li></ol><ol></ol><li>Test the function with a Deal that has a WorkDrive Team Folder attached.</li><li>Save the function.</li></ol></div>
</div><div data-element-id="elm_H8fAKd_WczpG-aXn7TY2Ew" data-element-type="row" class="zprow zprow-container zpalign-items-flex-start zpjustify-content-flex-start zpdefault-section zpdefault-section-bg " data-equal-column=""><style type="text/css"> [data-element-id="elm_H8fAKd_WczpG-aXn7TY2Ew"].zprow{ border-radius:1px; padding:0px; margin:0px; } </style><div data-element-id="elm_vATwNvQtHt_Lb9UIsJ_ysw" data-element-type="column" class="zpelem-col zpcol-12 zpcol-md-12 zpcol-sm-12 zpalign-self- zpdefault-section zpdefault-section-bg "><style type="text/css"> [data-element-id="elm_vATwNvQtHt_Lb9UIsJ_ysw"].zpelem-col{ border-radius:1px; padding:0px; margin:0px; } </style><div data-element-id="elm_wwXiouMai5DJkNfQwsy17w" data-element-type="box" class="zpelem-box zpelement zpbox-container zpdefault-section zpdefault-section-bg "><style type="text/css"> [data-element-id="elm_wwXiouMai5DJkNfQwsy17w"].zpelem-box{ background-color:#34495E; background-image:unset; border-style:solid; border-color:rgba(45,141,180,1) !important; border-width:1px; border-radius:5px; padding:0px; margin:0px; } </style><div data-element-id="elm_hW28a2NU066oD2gZzH_AKw" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_hW28a2NU066oD2gZzH_AKw"].zpelem-text { border-radius:1px; padding:20px; margin:0px; } </style><div class="zptext zptext-align-left " data-editor="true"><div><div><div><span style="color:rgb(255, 255, 255);">folder_info = zoho.crm.getRelatedRecords(&quot;Attachments&quot;,&quot;Deals&quot;,deal_id);</span></div><div><span style="color:rgb(255, 255, 255);">//this section finds the link in the attachments section, then it creates a list of elements in the link, and then picks the 8th element, which is the folder ID</span></div><div><span style="color:rgb(255, 255, 255);">Parent_Folder_ID = folder_info.get(0).get(&quot;$link_url&quot;).toList(&quot;/&quot;).get(8);</span></div><div><span style="color:rgb(255, 255, 255);">info Parent_Folder_ID;</span></div><div><span style="color:rgb(255, 255, 255);">// Option 2 to find the folder ID</span></div><div><span style="color:rgb(255, 255, 255);">// count = 0;</span></div><div><span style="color:rgb(255, 255, 255);">// for each&nbsp; item in folder_info</span></div><div><span style="color:rgb(255, 255, 255);">// {</span></div><div><span style="color:rgb(255, 255, 255);">// owner_id = folder_info.get(count).get(&quot;Owner&quot;).get(&quot;id&quot;);</span></div><div><span style="color:rgb(255, 255, 255);">// if(owner_id == &quot;4038274000010997002&quot;)</span></div><div><span style="color:rgb(255, 255, 255);">// {</span></div><div><span style="color:rgb(255, 255, 255);">// Parent_Folder_ID = folder_info.get(count).get(&quot;$link_url&quot;).toList(&quot;/&quot;).get(8);</span></div><div><span style="color:rgb(255, 255, 255);">// info Parent_Folder_ID;</span></div><div><span style="color:rgb(255, 255, 255);">// }</span></div><div><span style="color:rgb(255, 255, 255);">// count = count + 1;</span></div><div><span style="color:rgb(255, 255, 255);">// }</span></div><div><span style="color:rgb(255, 255, 255);">// Option 3: manually add the team folder ID</span></div><div><span style="color:rgb(255, 255, 255);">// Parent_Folder_ID = &quot;replacewithyourteamfolder&quot;;</span></div><div><span style="color:rgb(255, 255, 255);">// creating folder 1 ------------------------------------------------</span></div><div><span style="color:rgb(255, 255, 255);">folder_1 = zoho.workdrive.createFolder(&quot;Folder 1 Name&quot;,Parent_Folder_ID,&quot;crm_workdrive&quot;);</span></div><div><span style="color:rgb(255, 255, 255);">folder_1_id = folder_1.get(&quot;data&quot;).get(&quot;id&quot;);</span></div><div><span style="color:rgb(255, 255, 255);">//creating sub folders</span></div><div><span style="color:rgb(255, 255, 255);">subfolder_1 = zoho.workdrive.createFolder(&quot;Subfolder 1 Name&quot;,folder_1_id,&quot;crm_workdrive&quot;);</span></div><div><span style="color:rgb(255, 255, 255);">subfolder_2 = zoho.workdrive.createFolder(&quot;Subfolder 2 Name&quot;,folder_1_id,&quot;crm_workdrive&quot;);</span></div><div><span style="color:rgb(255, 255, 255);">// creating folder 2 -----------------------------------------------</span></div><div><span style="color:rgb(255, 255, 255);">folder_2 = zoho.workdrive.createFolder(&quot;Folder 2 Name&quot;,Parent_Folder_ID,&quot;crm_workdrive&quot;);</span></div><div><span style="color:rgb(255, 255, 255);">folder_2_id = folder_2.get(&quot;data&quot;).get(&quot;id&quot;);</span></div><div><span style="color:rgb(255, 255, 255);">//creating subfolders from list</span></div><div><span style="color:rgb(255, 255, 255);">subfolders = {&quot;Subfolder 3 Name&quot;,&quot;Subfolder 4 Name&quot;,&quot;Subfolder 5 Name&quot;,&quot;Subfolder 6 Name&quot;};</span></div><div><span style="color:rgb(255, 255, 255);">for each&nbsp; rec in subfolders</span></div><div><span style="color:rgb(255, 255, 255);">{</span></div><div><span style="color:rgb(255, 255, 255);">zoho.workdrive.createFolder(rec,folder_2_id,&quot;crm_workdrive&quot;);</span></div><div><span style="color:rgb(255, 255, 255);">}</span></div></div></div>
</div></div></div></div></div><div data-element-id="elm_F7_PNwVPap_oNUNACZmkRw" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_F7_PNwVPap_oNUNACZmkRw"].zpelem-heading { border-radius:1px; } </style><h2
 class="zpheading zpheading-align-left " data-editor="true">Creating a workflow</h2></div>
<div data-element-id="elm_0pXVcsx7xtyb2sp-wX_Rdg" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_0pXVcsx7xtyb2sp-wX_Rdg"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><div style="color:inherit;"><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 stage changes)</li><li>Configure your workflow trigger and conditions:</li><ol><li>When &gt; on a record action &gt; Edit &gt; &quot;Subfolders Needed&quot; is modified to the value of &quot;Yes&quot;</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;deal_id&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<br></li></ol></div></div>
</div></div></div></div></div></div> ]]></content:encoded><pubDate>Thu, 08 Jun 2023 16:12:52 -0700</pubDate></item><item><title><![CDATA[Function: Create a WorkDrive Team Folder and attach it to the CRM record]]></title><link>https://www.blungo.com/blogs/post/function-create-a-workdrive-team-folder-and-attach-it-to-the-crm-record</link><description><![CDATA[<img align="left" hspace="5" src="https://www.blungo.com/Blogpost/Thumbnails/Funcion- create workdrive team folder.png"/>We are going to create a workflow that will trigger a function that creates a Team folder in Zoho WorkDrive, and the folder will be attached to the attachments section in the CRM record. We are going to create a connection, then work on the function, and finally create the workflow.]]></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"> [data-element-id="elm_8IviC7roTWy1pB8T5m2pag"].zpsection{ border-radius:1px; } </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_LzB0GcByTVzOvXDnsiVWog" data-element-type="iframe" class="zpelement zpelem-iframe "><style type="text/css"> [data-element-id="elm_LzB0GcByTVzOvXDnsiVWog"].zpelem-iframe{ border-radius:1px; } </style><div class="zpiframe-container zpiframe-align-center"><iframe class="zpiframe " src="https://www.youtube.com/embed/14ivaEjK9Gg" 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><span style="color:inherit;"><span style="font-size:12pt;">We are going to create a workflow that will trigger a function that creates a Team folder in Zoho WorkDrive, and the folder will be attached to the attachments section in the CRM record. We are going to create a connection, then work on the function, and finally create the workflow.</span></span><br></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">Important notes</h2></div>
<div data-element-id="elm_hz8PZ4Xcqs0QNEQoK-bF4A" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_hz8PZ4Xcqs0QNEQoK-bF4A"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><ul><li><span style="color:inherit;"><span style="font-size:12pt;">We are going to create a Team Folder. If you want to create a normal folder, check out the next tutorial.</span></span></li><li><span style="color:inherit;"><span style="font-size:12pt;">You have to have full access to Zoho CRM and WorkDrive.</span></span></li><li><span style="color:inherit;"><span style="font-size:12pt;">We are going to use the Deals module, but this works with any module, as long as the attachments section is enabled.</span></span></li></ul></div>
</div><div data-element-id="elm_bH9HTWKeMYa0wBOHoFGR9Q" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_bH9HTWKeMYa0wBOHoFGR9Q"].zpelem-heading { border-radius:1px; } </style><h2
 class="zpheading zpheading-align-left " data-editor="true">Creating a connection</h2></div>
<div data-element-id="elm_dXzVsdkCiYi3-R5EpU9GEQ" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_dXzVsdkCiYi3-R5EpU9GEQ"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><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;<span style="background-color:rgb(178, 234, 121);">crm_workdrive</span>&quot;.</li><li>Add the scopes. Use the magnifier to easily find the scopes.</li><ol><li>List of scopes:&nbsp;ZohoCRM.modules.ALL, zohosearch.securesearch.READ, WorkDrive.team.ALL, WorkDrive.workspace.ALL, WorkDrive.files.ALL, WorkDrive.organization.READ, WorkDrive.members.READ, WorkDrive.members.CREATE, WorkDrive.members.UPDATE, WorkDrive.members.DELETE, WorkDrive.teamfolders.CREATE, WorkDrive.teamfolders.READ, WorkDrive.teamfolders.UPDATE, WorkDrive.teamfolders.DELETE, WorkDrive.teamfolders.sharing.CREATE, WorkDrive.teamfolders.sharing.READ, WorkDrive.teamfolders.sharing.UPDATE, WorkDrive.teamfolders.sharing.DELETE, WorkDrive.teamfolders.admin.READ, WorkDrive.groups.CREATE, WorkDrive.groups.READ, WorkDrive.groups.UPDATE, WorkDrive.groups.DELETE, WorkDrive.DataTemplates.CREATE, WorkDrive.DataTemplates.DELETE, WorkDrive.DataTemplates.UPDATE, WorkDrive.links.ALL, WorkDrive.users.READ</li></ol><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><div data-element-id="elm_FaQu2poynxcvsxnK4vLvCQ" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_FaQu2poynxcvsxnK4vLvCQ"].zpelem-heading { border-radius:1px; } </style><h2
 class="zpheading zpheading-align-left " data-editor="true">Setting up the function</h2></div>
<div data-element-id="elm_IYa4I1DOPxWtTnCpxCUwRQ" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_IYa4I1DOPxWtTnCpxCUwRQ"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><ol><li>In the Zoho CRM settings, go to &quot;Functions&quot; under &quot;Developer Space&quot;.</li><li>Create a new function: Add a name and select &quot;Automation&quot; as the category.</li><li>Copy the function located below and paste it in the text editor in Zoho CRM.</li><li>Edit the arguments: add &quot;deal_id&quot; as a string.<br></li><li>Get the parent folder ID from Zoho WorkDrive (on the URL).</li><ol><li>Replace &quot;yourparentfolderid&quot; with the id from the URL.</li></ol><ol></ol><li>Make changes to the createTeamFolder function's parameters if needed:</li><ol><li>Add a description or leave it empty (&quot;&quot;).</li><li>Select if it's a public folder (&quot;true&quot;) or private folder (&quot;false&quot;).</li><li>Make sure the connection name matches the connection you created in the previous step.</li></ol><ol></ol><li>Test the function with any deal.</li><li>Save the function.</li></ol></div>
</div><div data-element-id="elm_H8fAKd_WczpG-aXn7TY2Ew" data-element-type="row" class="zprow zprow-container zpalign-items-flex-start zpjustify-content-flex-start zpdefault-section zpdefault-section-bg " data-equal-column=""><style type="text/css"> [data-element-id="elm_H8fAKd_WczpG-aXn7TY2Ew"].zprow{ border-radius:1px; padding:0px; margin:0px; } </style><div data-element-id="elm_vATwNvQtHt_Lb9UIsJ_ysw" data-element-type="column" class="zpelem-col zpcol-12 zpcol-md-12 zpcol-sm-12 zpalign-self- zpdefault-section zpdefault-section-bg "><style type="text/css"> [data-element-id="elm_vATwNvQtHt_Lb9UIsJ_ysw"].zpelem-col{ border-radius:1px; padding:0px; margin:0px; } </style><div data-element-id="elm_wwXiouMai5DJkNfQwsy17w" data-element-type="box" class="zpelem-box zpelement zpbox-container zpdefault-section zpdefault-section-bg "><style type="text/css"> [data-element-id="elm_wwXiouMai5DJkNfQwsy17w"].zpelem-box{ background-color:#34495E; background-image:unset; border-style:solid; border-color:rgba(45,141,180,1) !important; border-width:1px; border-radius:5px; padding:0px; margin:0px; } </style><div data-element-id="elm_hW28a2NU066oD2gZzH_AKw" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_hW28a2NU066oD2gZzH_AKw"].zpelem-text { border-radius:1px; padding:20px; margin:0px; } </style><div class="zptext zptext-align-left " data-editor="true"><div><div><div><div><span style="color:rgb(255, 255, 255);">DealInfo = zoho.crm.getRecordById(&quot;Deals&quot;,deal_id);</span></div><div><span style="color:rgb(255, 255, 255);">DealName = DealInfo.get(&quot;Deal_Name&quot;);</span></div><div><span style="color:rgb(255, 255, 255);">ParentFolderID = &quot;yourparentfolderid&quot;;</span></div><div><span style="color:rgb(255, 255, 255);">// limiting the amount of characters because the Workdrive folder name has a limit</span></div><div><span style="color:rgb(255, 255, 255);">if(DealName.len() &gt;= 40)</span></div><div><span style="color:rgb(255, 255, 255);">{</span></div><div><span style="color:rgb(255, 255, 255);">DealName = DealName.subString(0,40);</span></div><div><span style="color:rgb(255, 255, 255);">}</span></div><div><span style="color:rgb(255, 255, 255);">FolderName = DealName + &quot; - Main Folder&quot;;</span></div><div><span style="color:rgb(255, 255, 255);">// folder name - parent folder id - description - public - connection</span></div><div><span style="color:rgb(255, 255, 255);">Create_Team_Folder = zoho.workdrive.createTeamFolder(FolderName,ParentFolderID,&quot;Description test&quot;,true,&quot;crm_workdrive&quot;);</span></div><div><span style="color:rgb(255, 255, 255);">info Create_Team_Folder;</span></div><div><span style="color:rgb(255, 255, 255);">Team_Folder_ID = Create_Team_Folder.get(&quot;data&quot;).get(&quot;id&quot;);</span></div><div><span style="color:rgb(255, 255, 255);">info Team_Folder_ID;</span></div><div><span style="color:rgb(255, 255, 255);">// adding users to the team drive folder ----------------------------------------------</span></div><div><span style="color:rgb(255, 255, 255);">// l = {&quot;email1@yourdomain.com&quot;,&quot;email2@yourdomain.com&quot;};</span></div><div><span style="color:rgb(255, 255, 255);">// for each email in l</span></div><div><span style="color:rgb(255, 255, 255);">// {</span></div><div><span style="color:rgb(255, 255, 255);">// header = Map();</span></div><div><span style="color:rgb(255, 255, 255);">// header.put(&quot;Accept&quot;,&quot;application/vnd.api+json&quot;);</span></div><div><span style="color:rgb(255, 255, 255);">// data = Map();</span></div><div><span style="color:rgb(255, 255, 255);">// data_param1 = Map();</span></div><div><span style="color:rgb(255, 255, 255);">// att_param1 = Map();</span></div><div><span style="color:rgb(255, 255, 255);">// att_param1.put(&quot;resource_id&quot;,Team_Folder_ID);</span></div><div><span style="color:rgb(255, 255, 255);">// att_param1.put(&quot;shared_type&quot;,&quot;workspace&quot;);</span></div><div><span style="color:rgb(255, 255, 255);">// att_param1.put(&quot;email_id&quot;,email);</span></div><div><span style="color:rgb(255, 255, 255);">// att_param1.put(&quot;role_id&quot;,&quot;1&quot;);</span></div><div><span style="color:rgb(255, 255, 255);">// data_param1.put(&quot;attributes&quot;,att_param1);</span></div><div><span style="color:rgb(255, 255, 255);">// data_param1.put(&quot;type&quot;,&quot;members&quot;);</span></div><div><span style="color:rgb(255, 255, 255);">// data.put(&quot;data&quot;,data_param1);</span></div><div><span style="color:rgb(255, 255, 255);">// response = invokeurl</span></div><div><span style="color:rgb(255, 255, 255);">// [</span></div><div><span style="color:rgb(255, 255, 255);">// url :&quot;https://www.zohoapis.com/workdrive/api/v1/members&quot;</span></div><div><span style="color:rgb(255, 255, 255);">// type :POST</span></div><div><span style="color:rgb(255, 255, 255);">// parameters:data.toString()</span></div><div><span style="color:rgb(255, 255, 255);">// headers:header</span></div><div><span style="color:rgb(255, 255, 255);">// connection:&quot;crm_workdrive&quot;</span></div><div><span style="color:rgb(255, 255, 255);">// ];</span></div><div><span style="color:rgb(255, 255, 255);">// info response;</span></div><div><span style="color:rgb(255, 255, 255);">// }</span></div><div><span style="color:rgb(255, 255, 255);">// // link folder as ATTACHMENT IN CRM ------------------------------------------------</span></div><div><span style="color:rgb(255, 255, 255);">dataList = List();</span></div><div><span style="color:rgb(255, 255, 255);">data = Map();</span></div><div><span style="color:rgb(255, 255, 255);">data.put(&quot;$link_url&quot;,&quot;https://workdrive.zoho.com/home/&quot; + ParentFolderID + &quot;/teams/&quot; + ParentFolderID + &quot;/ws/&quot; + Team_Folder_ID + &quot;/folders/files&quot;);</span></div><div><span style="color:rgb(255, 255, 255);">data.put(&quot;File_Name&quot;,FolderName);</span></div><div><span style="color:rgb(255, 255, 255);">data.put(&quot;$type&quot;,&quot;teamdrive&quot;);</span></div><div><span style="color:rgb(255, 255, 255);">dataList.add(data);</span></div><div><span style="color:rgb(255, 255, 255);">payload = &quot;attachments=&quot; + zoho.encryption.urlEncode({&quot;data&quot;:dataList});</span></div><div><span style="color:rgb(255, 255, 255);">response = invokeurl</span></div><div><span style="color:rgb(255, 255, 255);">[</span></div><div><span style="color:rgb(255, 255, 255);">url :&quot;https://www.zohoapis.com/crm/v3/Deals/&quot; + deal_id + &quot;/Attachments&quot;</span></div><div><span style="color:rgb(255, 255, 255);">type :POST</span></div><div><span style="color:rgb(255, 255, 255);">parameters:payload</span></div><div><span style="color:rgb(255, 255, 255);">connection:&quot;crm_workdrive&quot;</span></div><div><span style="color:rgb(255, 255, 255);">content-type:&quot;application/x-www-form-urlencoded&quot;</span></div><div><span style="color:rgb(255, 255, 255);">];</span></div></div></div>
</div></div></div></div></div></div><div data-element-id="elm_F7_PNwVPap_oNUNACZmkRw" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_F7_PNwVPap_oNUNACZmkRw"].zpelem-heading { border-radius:1px; } </style><h2
 class="zpheading zpheading-align-left " data-editor="true">Creating a workflow</h2></div>
<div data-element-id="elm_0pXVcsx7xtyb2sp-wX_Rdg" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_0pXVcsx7xtyb2sp-wX_Rdg"].zpelem-text { border-radius:1px; } </style><div class="zptext zptext-align-left " data-editor="true"><div style="color:inherit;"><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 stage changes)</li><li>Configure your workflow trigger and conditions:</li><ol><li>When &gt; on a record action &gt; Edit &gt; Stage is modified to the value of Won</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;deal_id&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<br></li></ol></div></div>
</div></div></div></div></div></div> ]]></content:encoded><pubDate>Fri, 26 May 2023 09:54:32 -0700</pubDate></item></channel></rss>