<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Developing a recipe with recursive looping in Workato Pros Discussion Board</title>
    <link>https://systematic.workato.com/t5/workato-pros-discussion-board/developing-a-recipe-with-recursive-looping/m-p/4943#M2198</link>
    <description>&lt;P&gt;Good morning Jen,&lt;/P&gt;&lt;P&gt;I believe that's a limitation of Recipe Functions to prevent infinite loops.&amp;nbsp; Is there a way you can accomplish what you want using a Repeat block instead?&amp;nbsp; I haven't used the Google Drive connector so I'm not familiar with it, but it might be an option, albeit imperfect.&lt;/P&gt;&lt;P&gt;Another longshot might be if the Recursive error is being thrown b/c Workato sees them as dependencies.&amp;nbsp; When you clone a recipe, the new one is "linked" to the parent recipe.&amp;nbsp; If you clone it a 2nd time, so your original is A, first clone is B, and 2nd clone is C, then delete recipe B, now C and A will be independent of one another.&amp;nbsp; You could try that too in case that link is the problem.&lt;/P&gt;</description>
    <pubDate>Wed, 16 Aug 2023 13:29:22 GMT</pubDate>
    <dc:creator>mppowe</dc:creator>
    <dc:date>2023-08-16T13:29:22Z</dc:date>
    <item>
      <title>Developing a recipe with recursive looping</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/developing-a-recipe-with-recursive-looping/m-p/4941#M2196</link>
      <description>&lt;P&gt;I am developing a recipe to look through for files and folders on Google Drive that contain a particular string in the name. As you might imagine, I need to develop a recursive loop to get into all of the nested folders. I created a parent recipe to kick off the process, which calls a recipe function (A) to look into the root level folder's files and subfolder names. Then I cloned that recipe, and called the clone (B) from the first recipe function (A). However, when I try to call recipe function A from recipe function B, I am getting an error:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Recursive invocation detected&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I've tried creating even a second clone, in case the recursion was only detected if calling a recipe that was the calling recipe of the current recipe (yikes! brain spaghetti), but that did not solve the problem.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Has anyone identified a way to recursive travel down a folder structure without a pre-defined number of levels?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 23:35:06 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/developing-a-recipe-with-recursive-looping/m-p/4941#M2196</guid>
      <dc:creator>jmcvicker</dc:creator>
      <dc:date>2023-08-15T23:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Developing a recipe with recursive looping</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/developing-a-recipe-with-recursive-looping/m-p/4943#M2198</link>
      <description>&lt;P&gt;Good morning Jen,&lt;/P&gt;&lt;P&gt;I believe that's a limitation of Recipe Functions to prevent infinite loops.&amp;nbsp; Is there a way you can accomplish what you want using a Repeat block instead?&amp;nbsp; I haven't used the Google Drive connector so I'm not familiar with it, but it might be an option, albeit imperfect.&lt;/P&gt;&lt;P&gt;Another longshot might be if the Recursive error is being thrown b/c Workato sees them as dependencies.&amp;nbsp; When you clone a recipe, the new one is "linked" to the parent recipe.&amp;nbsp; If you clone it a 2nd time, so your original is A, first clone is B, and 2nd clone is C, then delete recipe B, now C and A will be independent of one another.&amp;nbsp; You could try that too in case that link is the problem.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2023 13:29:22 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/developing-a-recipe-with-recursive-looping/m-p/4943#M2198</guid>
      <dc:creator>mppowe</dc:creator>
      <dc:date>2023-08-16T13:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: Developing a recipe with recursive looping</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/developing-a-recipe-with-recursive-looping/m-p/4958#M2204</link>
      <description>&lt;P&gt;Unfortunately the clone-twice/delete linkage didn't work to resolve my issue. For anyone else who tries to do this in the future, I'll outline how I got around it here:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Create a lookup table with 5 columns: folder_name, folder_id, folder_level, logged, rename_check&lt;/LI&gt;&lt;LI&gt;Populate the first row of the lookup table with the root folder info: name, id, level = 1, logged = 0, rename_check = 0&lt;/LI&gt;&lt;LI&gt;Create a scheduled recipe to run every 5 minutes. Recipe actions:&lt;UL&gt;&lt;LI&gt;Search entries in the lookup table for records where logged = 0&lt;/LI&gt;&lt;LI&gt;Do a repeat loop for each result found in the lookup table. In that repeat loop:&amp;nbsp;&lt;UL&gt;&lt;LI&gt;Search for folders in google drive. If list size of the results &amp;gt; 0, batch-add the subfolders to the lookup table, setting level = level of the current folder plus one, logged = 0, rename_check = 0&lt;/LI&gt;&lt;LI&gt;Update the current folder record, setting logged = 1&lt;/LI&gt;&lt;LI&gt;If the folder name contains the string we're looking to replace, rename the folder&lt;/LI&gt;&lt;LI&gt;Whether or not the folder was renamed, set rename_check = 1&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;End repeat loop&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;End recipe&lt;/LI&gt;&lt;LI&gt;Finally, create a separate recipe to loop through all the folders in the lookup table, searching for filenames within each folder that contains the string we want to replace&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Thu, 17 Aug 2023 22:33:13 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/developing-a-recipe-with-recursive-looping/m-p/4958#M2204</guid>
      <dc:creator>jmcvicker</dc:creator>
      <dc:date>2023-08-17T22:33:13Z</dc:date>
    </item>
  </channel>
</rss>

