<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Path of a document or folder</title><link>https://community.appian.com/discussions/f/general/21226/path-of-a-document-or-folder</link><description>Good morning, 
 We have an interface in which we are using! DocumentAndFolderBrowserFieldColumns to paint a hierarchy of documents, the problem is that we are trying to obtain the path to display it as text in the following way, 
 if we have the following</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Path of a document or folder</title><link>https://community.appian.com/thread/82893?ContentTypeID=1</link><pubDate>Wed, 23 Jun 2021 16:40:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:54fae868-50e1-42f4-b340-a245658412d9</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Yup! Thanks for confirming.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Path of a document or folder</title><link>https://community.appian.com/thread/82891?ContentTypeID=1</link><pubDate>Wed, 23 Jun 2021 16:13:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a53a5c7a-fc73-4912-8b53-fa5810ba3b23</guid><dc:creator>sandrap845</dc:creator><description>&lt;p&gt;&lt;span&gt;Thank you very much Mike, your explanation and example have been very helpful to me!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Path of a document or folder</title><link>https://community.appian.com/thread/82890?ContentTypeID=1</link><pubDate>Wed, 23 Jun 2021 16:00:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:88c25c82-cacf-4896-b4ab-cdd61d964d9a</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;For a more concrete example... the following is the definition of &lt;em&gt;&lt;strong&gt;TEST_findParentRecursive()&lt;/strong&gt;&lt;/em&gt; which will find all folder IDs up to the root knowledge center.&amp;nbsp; The rule calls itself whenever it detects a parent object is present.&amp;nbsp; The result is an array of map objects containing various data from lowest-level to highest.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!localVariables(
  local!parent: folder(ri!folderId, &amp;quot;parentFolderId&amp;quot;),
  local!hasParent: not(isnull(local!parent)),

  {
    a!map(
      folder: ri!folderId,
      folderId: tointeger(ri!folderId),
      isTopmostFolder: not(local!hasParent),
      parentFolder: tofolder(local!parent),
      parentFolderOd: local!parent
    ),
    if(
      local!hasParent,
      rule!TEST_findParentRecursive(
        folderId: local!parent
      ),
      {}
    )
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Path of a document or folder</title><link>https://community.appian.com/thread/82888?ContentTypeID=1</link><pubDate>Wed, 23 Jun 2021 15:35:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bb047705-de17-4cb3-8444-1fe462635f24</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;You just call the rule from itself.&amp;nbsp; It&amp;#39;s relatively easy once you wrap your head around the concept.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Path of a document or folder</title><link>https://community.appian.com/thread/82887?ContentTypeID=1</link><pubDate>Wed, 23 Jun 2021 15:04:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:78c09f67-857e-4dc2-ac92-1d27c9d5c459</guid><dc:creator>sandrap845</dc:creator><description>&lt;p&gt;Good mike,&lt;/p&gt;
&lt;p&gt;I have the problem with calling itself, I have the rule rule! GetFather, which it does is from the current id it gets the father&amp;#39;s if there is one and I understand that I have to call it recursively, but I don&amp;#39;t know how make the recursive call, since I can&amp;#39;t use a foreach because I don&amp;#39;t know how many there will be.&lt;/p&gt;
&lt;p&gt;Any ideas?&lt;/p&gt;
&lt;p&gt;Greetings and thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Path of a document or folder</title><link>https://community.appian.com/thread/82886?ContentTypeID=1</link><pubDate>Wed, 23 Jun 2021 14:54:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b438cd83-7f8d-4671-9213-101de6d11b84</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;You would just make a rule that gets the parent of the current object, if there is none it returns null, and if there is one it returns the parent and then calls itself again to get the parent of that object.&amp;nbsp; When calling such a rule from a (separate) rule or interface, you would end up with an array of IDs that represents the entire hierarchy to root.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Path of a document or folder</title><link>https://community.appian.com/thread/82885?ContentTypeID=1</link><pubDate>Wed, 23 Jun 2021 14:48:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f13a6330-0718-4620-9a45-e6c8c42635e7</guid><dc:creator>sandrap845</dc:creator><description>&lt;p&gt;Good Stefan,&lt;br /&gt;Well, because I have the doubt of how to do it, I see that I cannot do it with a foreach because I do not have the starting list but from an id I have to find the superior one and as I told you I do not know how to do it I have the rule that returns me the top id but I don&amp;#39;t know how to call it recursively.&lt;/p&gt;
&lt;p&gt;Any idea or example?&lt;/p&gt;
&lt;p&gt;A greeting and thanks in advance&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Path of a document or folder</title><link>https://community.appian.com/thread/82884?ContentTypeID=1</link><pubDate>Wed, 23 Jun 2021 14:43:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5acb7b71-2a92-44c0-b146-38511042518d</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;My I ask why you cannot call it recursively?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Path of a document or folder</title><link>https://community.appian.com/thread/82880?ContentTypeID=1</link><pubDate>Wed, 23 Jun 2021 12:42:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7e397b34-b06e-4c84-a767-4c3485047f11</guid><dc:creator>sandrap845</dc:creator><description>&lt;p&gt;Hi Danny thanks for the contribution, the problem is that I think I have to do the hierarchy from back to front, that is, file, parent folder, parent folder if there is one and so on, I have made a rule in which from I can get its parent for a given element (either from a file or a folder) the problem is that I can&amp;#39;t call it recursively.&lt;br /&gt;Greetings and thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Path of a document or folder</title><link>https://community.appian.com/thread/82757?ContentTypeID=1</link><pubDate>Fri, 18 Jun 2021 13:37:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:99c76d16-21bd-45a8-b09f-2e88b929aee1</guid><dc:creator>Danny Verb</dc:creator><description>&lt;p&gt;I recommend the content tools plugin&amp;nbsp;&lt;a href="/b/appmarket/posts/content-tools"&gt;https://community.appian.com/b/appmarket/posts/content-tools&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can use functions such as &amp;#39;getdocumentsfromfolder&amp;#39; and &amp;#39;getsubfolders&amp;#39; to create your own hierarchy&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>