<?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>Check if a document exists in Appian</title><link>https://community.appian.com/discussions/f/general/27886/check-if-a-document-exists-in-appian</link><description>So I have an interface that has links to documents that have been uploaded. However, the documents don&amp;#39;t exist until after they&amp;#39;ve gone through a process model (or rather they&amp;#39;re a temp file that you can&amp;#39;t reference at that time). What I&amp;#39;d like to do</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Check if a document exists in Appian</title><link>https://community.appian.com/thread/130025?ContentTypeID=1</link><pubDate>Fri, 23 Feb 2024 15:09:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ae503a80-bd59-4073-a997-64e71441830f</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;I noticed the &amp;quot;invactive&amp;quot; typo and filed a bug report for it with the plug-in authors... 5 years ago maybe?&amp;nbsp; maybe more?&lt;/p&gt;
&lt;p&gt;Anyway here&amp;#39;s my expression rule that tests whether any given ID is an *existing, inactive document*.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;and(
  rule!UTIL_docExists(ri!doc),  /* does &amp;quot;not null or 0&amp;quot; check, checks using &amp;quot;is [document] object exists&amp;quot; function; if all are true, returns true */
  find(
    /*&amp;quot;State: Invactive Published&amp;quot;,*/
    /* note misspelling above.  instead, checking against the correctly-spelled output for Active documents */
    &amp;quot;State: Active Published&amp;quot;,
    getcontentobjectdetailsbyid(ri!doc)
  ) = 0
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Check if a document exists in Appian</title><link>https://community.appian.com/thread/130021?ContentTypeID=1</link><pubDate>Fri, 23 Feb 2024 13:55:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:709d74ae-808a-437b-a32c-8dee917dc1fd</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;Its a spam.&amp;nbsp;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/11/pastedimage1708696542978v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Check if a document exists in Appian</title><link>https://community.appian.com/thread/130019?ContentTypeID=1</link><pubDate>Fri, 23 Feb 2024 13:23:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:84d9e007-a10a-4174-a304-401b3b078857</guid><dc:creator>David Jimenez </dc:creator><description>&lt;p&gt;Use &lt;span&gt;getDocumentsFromFolder&amp;nbsp;in the root folder.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Check if a document exists in Appian</title><link>https://community.appian.com/thread/130018?ContentTypeID=1</link><pubDate>Fri, 23 Feb 2024 13:06:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:46a21c58-e6c1-452e-bd26-3ad2062c6ef1</guid><dc:creator>Richard Michaelis</dc:creator><description>&lt;p&gt;Quick input:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!objectDetails: if(
    a!isNullOrEmpty(ri!objectId),
    &amp;quot;No object with this ID has been found&amp;quot;,
    getcontentobjectdetailsbyid(ri!objectId)
  ),
  /*if(
    tostring(local!objectDetails) = &amp;quot;No object with this ID has been found&amp;quot;,
    false,
    true
  )
  
  Dont do this kind of &amp;quot;if clause&amp;quot; if you can avoid ;)
  */
  
  tostring(local!objectDetails) &amp;lt;&amp;gt; &amp;quot;No object with this ID has been found&amp;quot;,
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Check if a document exists in Appian</title><link>https://community.appian.com/thread/109001?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2023 08:42:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e43b62d5-ea5d-4bed-98b8-aae7fb540c5b</guid><dc:creator>adeleb9274</dc:creator><description>[deleted]&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Check if a document exists in Appian</title><link>https://community.appian.com/thread/108830?ContentTypeID=1</link><pubDate>Fri, 03 Mar 2023 19:10:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fb1ca0fa-8b23-4f82-97f4-433db93d2dbc</guid><dc:creator>Marco</dc:creator><description>&lt;p&gt;Yes I know, the issue was to be able to look at a document ID and tell if it has been published yet or not.&amp;nbsp;&lt;span&gt;getcontentobjectdetailsbyid() allowed me to do that&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Check if a document exists in Appian</title><link>https://community.appian.com/thread/108510?ContentTypeID=1</link><pubDate>Sat, 25 Feb 2023 03:35:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3b1a017b-e147-46aa-aba2-784e66b0124b</guid><dc:creator>ujjwalr0002</dc:creator><description>&lt;p&gt;Hi, Marco&lt;/p&gt;
&lt;p&gt;The document must be active published check the below link for more info.&lt;/p&gt;
&lt;p&gt;&lt;a href="/discussions/f/user-interface/25775/error-when-use-function-document"&gt;https://community.appian.com/discussions/f/user-interface/25775/error-when-use-function-document&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Check if a document exists in Appian</title><link>https://community.appian.com/thread/108507?ContentTypeID=1</link><pubDate>Fri, 24 Feb 2023 22:33:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:569b6954-a4dc-4e20-a8d6-75d17f0385e4</guid><dc:creator>Marco</dc:creator><description>&lt;p&gt;I think I can work with this somehow. Just noticed a typo in the output though. Any idea who I&amp;#39;d report that to? The state for docs that haven&amp;#39;t been published yet is,&amp;nbsp;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;&amp;quot;State: Invactive Published&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Check if a document exists in Appian</title><link>https://community.appian.com/thread/108506?ContentTypeID=1</link><pubDate>Fri, 24 Feb 2023 22:25:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ee63711e-2951-45bf-be0c-b6f554f785c2</guid><dc:creator>Abhay Dalsaniya</dc:creator><description>&lt;p&gt;getcontentobjectdetailsbyid(id)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Check if a document exists in Appian</title><link>https://community.appian.com/thread/108505?ContentTypeID=1</link><pubDate>Fri, 24 Feb 2023 22:18:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fa8e097a-f786-4edf-b152-633727c7dd67</guid><dc:creator>Marco</dc:creator><description>&lt;p&gt;I need to search by id as the name is not unique&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Check if a document exists in Appian</title><link>https://community.appian.com/thread/108504?ContentTypeID=1</link><pubDate>Fri, 24 Feb 2023 22:17:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:470b58b4-5e57-463f-9e5b-74daeb87443d</guid><dc:creator>Marco</dc:creator><description>&lt;p&gt;Thanks, but this gives me true even though I can&amp;#39;t download the document yet. It somehow exists, but when I click the link I get a &amp;quot;Error 404 - Page Not Found&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Check if a document exists in Appian</title><link>https://community.appian.com/thread/108503?ContentTypeID=1</link><pubDate>Fri, 24 Feb 2023 22:11:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4d7b53f0-8da7-4ce1-a035-a9a7082428a9</guid><dc:creator>Naresh</dc:creator><description>&lt;p&gt;you can also use the below logic to find the object exist in the system&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="xml"&gt;a!localVariables(
  local!objectDetails: if(
    a!isNullOrEmpty(ri!objectId),
    &amp;quot;No object with this ID has been found&amp;quot;,
    getcontentobjectdetailsbyid(ri!objectId)
  ),
  if(
    tostring(local!objectDetails) = &amp;quot;No object with this ID has been found&amp;quot;,
    false,
    true
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Check if a document exists in Appian</title><link>https://community.appian.com/thread/108500?ContentTypeID=1</link><pubDate>Fri, 24 Feb 2023 21:57:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6ee6c7fc-1d14-49f2-8d91-de6636717eb9</guid><dc:creator>Abhay Dalsaniya</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;findcontentbyattribute(
  searchAllContent: true,
  contentType: &amp;quot;document&amp;quot;,
  attributeName: &amp;quot;name&amp;quot;,
  searchCriteria: &amp;quot;docName&amp;quot;
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;findcontentbyattribute()&lt;/strong&gt; is part of &lt;strong&gt;Content Tools plug-in&lt;/strong&gt;, It&amp;nbsp;should be available to most env. please do&amp;nbsp;deploy&amp;nbsp;if not.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>