<?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>How to check if documents exist?</title><link>https://community.appian.com/discussions/f/general/34863/how-to-check-if-documents-exist</link><description>Hi there, I am trying to create an expression rule that returns true if a document is not null, and has an ID attached to it. The expression rule is used to determine an XOR node to go to the document deletion node to delete the document if it exists</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to check if documents exist?</title><link>https://community.appian.com/thread/140532?ContentTypeID=1</link><pubDate>Thu, 12 Sep 2024 05:36:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:303b71e3-3e5d-4284-8bcb-b460c0d73202</guid><dc:creator>Shanmathi Ponnusamy</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;This is working but not sure whether this is good approach. Please give you thoughts.&amp;nbsp;&lt;a href="/members/stefanhelzle0001"&gt;Stefan Helzle&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;not(&lt;br /&gt; rule!CSCM_CheckIsNullOrEmpty(&lt;br /&gt; value: index(&lt;br /&gt; index(&lt;br /&gt; a!documentViewerField(document: ri!document),&lt;br /&gt; &amp;quot;contents&amp;quot;,&lt;br /&gt; null&lt;br /&gt; ),&lt;br /&gt; &amp;quot;documentUrl&amp;quot;,&lt;br /&gt; null&lt;br /&gt; )&lt;br /&gt; )&lt;br /&gt;)&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/11/pastedimage1726119324557v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/11/pastedimage1726119362033v2.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to check if documents exist?</title><link>https://community.appian.com/thread/135053?ContentTypeID=1</link><pubDate>Thu, 09 May 2024 12:24:50 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1fcbb17e-fc73-4e48-8f4d-f4eff8ecfb9f</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="21957" url="~/discussions/f/general/34863/how-to-check-if-documents-exist/134997"]i would propose a design that doesn&amp;#39;t require you to check for the existence of&amp;nbsp;a document[/quote]
&lt;p&gt;&lt;em&gt;&lt;strong&gt;*clicks nonexistent &amp;quot;like&amp;quot; button*&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to check if documents exist?</title><link>https://community.appian.com/thread/134997?ContentTypeID=1</link><pubDate>Thu, 09 May 2024 02:21:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6cec4d0a-1aa2-43e4-ac9f-de341e43b891</guid><dc:creator>Mathieu Drouin</dc:creator><description>&lt;p&gt;In that case, i would propose a design that doesn&amp;#39;t require you to check for the existence of&amp;nbsp;a document.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to check if documents exist?</title><link>https://community.appian.com/thread/134971?ContentTypeID=1</link><pubDate>Wed, 08 May 2024 16:47:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:aa0487f1-fcaf-46a2-9936-2665fcd24407</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;In those situations, I seem to have issues in other areas first - such as when a document is stored in a PV, but it is deleted via Related Action and the PV is not updated/cleared - I get forms not loading at all, etc (if they reference the document).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Expression evaluation error [evaluation ID = TPWUJ] in rule &amp;#39;form_xyz&amp;#39; at function a!fileUploadField_17r1 [line 142]: &lt;strong&gt;Invalid Content ID&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The string check isn&amp;#39;t perfect, but has worked for all my use cases so far &lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to check if documents exist?</title><link>https://community.appian.com/thread/134905?ContentTypeID=1</link><pubDate>Tue, 07 May 2024 21:03:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7c8cc50c-d56d-4cfc-8a92-8f66c188c27b</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;but what if a nonsense ID is passed in?&amp;nbsp; wouldn&amp;#39;t it still render the same, and return a fake result?&lt;/p&gt;
&lt;p&gt;(This would also apply when a document has already been deleted, but the process instance is still passing around references to its ID, as far as I know.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to check if documents exist?</title><link>https://community.appian.com/thread/134903?ContentTypeID=1</link><pubDate>Tue, 07 May 2024 20:29:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:431338cd-d398-4fbf-aeb6-a397970877d6</guid><dc:creator>David Jimenez </dc:creator><description>&lt;p&gt;Is an option to create your own plugin?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Anyway , in the post you can find different options to handle this case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to check if documents exist?</title><link>https://community.appian.com/thread/134897?ContentTypeID=1</link><pubDate>Tue, 07 May 2024 19:33:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:facdb29f-6338-4dcb-a47e-cb4195b1ce99</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;In my experience, simple works for me - my checks only convert the document object to string which equals &amp;quot;[Document:]&amp;quot; for nulls.&amp;nbsp; Have not had any issues with this yet.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;or(
  rule!APN_isEmpty(ri!doc),
  tostring(ri!doc)=&amp;quot;[Document:]&amp;quot;
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to check if documents exist?</title><link>https://community.appian.com/thread/134891?ContentTypeID=1</link><pubDate>Tue, 07 May 2024 18:19:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4ae4eaa7-c8f9-45f1-b61c-02afcf7652be</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;I also shared my own utility rule most recently &lt;a href="/discussions/f/general/34845/how-to-avoid-deleting-a-document-to-finish-a-process-model-event/134576"&gt;here&lt;/a&gt;.&amp;nbsp; (it uses the &amp;quot;object existence&amp;quot; plug-in as well as null-check all wrapped together in a nice general expression rule.)&amp;nbsp; I stand by my assertion that this really does require the use of a plug-in (at least for a solution that doesn&amp;#39;t cause an error to be thrown).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to check if documents exist?</title><link>https://community.appian.com/thread/134889?ContentTypeID=1</link><pubDate>Tue, 07 May 2024 18:15:43 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:67283277-6f8c-4b96-bacb-241ee8c97fd1</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="274702" url="~/discussions/f/general/34863/how-to-check-if-documents-exist/134723"]I do not know of any way to determine document existence without a plugin.[/quote]
&lt;p&gt;agreed - off the top of my head i think it maybe can&amp;#39;t be done (other than MAYBE some hack utilizing unsupported functionality, which is WAYYYYY off-limits if you&amp;#39;re already not even allowed to use plug-ins).&lt;/p&gt;
&lt;p&gt;Seriously though, OP - have your &amp;quot;supervisor&amp;quot; call me and tell me why they&amp;#39;re not allowing people to use plug-ins.&amp;nbsp; It&amp;#39;s an &lt;em&gt;&lt;strong&gt;absolutely ridiculous&lt;/strong&gt;&lt;/em&gt; requirement.&amp;nbsp; You can quote me on that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to check if documents exist?</title><link>https://community.appian.com/thread/134884?ContentTypeID=1</link><pubDate>Tue, 07 May 2024 17:48:43 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7fe23d53-853a-4c4b-a4d7-4afa70cbcd2d</guid><dc:creator>nickk1385</dc:creator><description>&lt;p&gt;It is installed but my supervisor asked me to avoid using Plugins for this story. It&amp;#39;s annoying I know but that&amp;#39;s why I asked here to see&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to check if documents exist?</title><link>https://community.appian.com/thread/134723?ContentTypeID=1</link><pubDate>Sun, 05 May 2024 16:52:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:22803f68-b00a-4b07-b2ee-64b008339af9</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;I do not know of any way to determine document existence without a plugin.&lt;/p&gt;
&lt;p&gt;But wait ... in the applications I build, I always store meta data to the database, and whenever a file is created or deleted, I use that meta data to perform that activity. So I never get into a situation where I need to check whether a file exists for some random id.&lt;/p&gt;
&lt;p&gt;Instead of solving the problem, I avoid it altogether.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to check if documents exist?</title><link>https://community.appian.com/thread/134718?ContentTypeID=1</link><pubDate>Sun, 05 May 2024 00:57:07 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a8363baf-5d08-43e0-8205-eef16668b376</guid><dc:creator>vinaykumar</dc:creator><description>&lt;p&gt;Hello &lt;a href="/members/nickk1385"&gt;nickk1385&lt;/a&gt; ,&lt;/p&gt;
&lt;p&gt;You can use getcontentobjectdetailsbyid() function to check if the document exists or not.&lt;/p&gt;
&lt;p&gt;If it does not exists, you would see &amp;quot;No object with this ID has been found&amp;quot; as an output.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to check if documents exist?</title><link>https://community.appian.com/thread/134708?ContentTypeID=1</link><pubDate>Sat, 04 May 2024 01:55:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ed6881f9-28b3-41b5-a5ef-479f274e9e98</guid><dc:creator>Mathieu Drouin</dc:creator><description>&lt;p&gt;You have no plugins installed in your environment?&lt;/p&gt;
&lt;p&gt;Content Tools is a pretty common one.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to check if documents exist?</title><link>https://community.appian.com/thread/134697?ContentTypeID=1</link><pubDate>Fri, 03 May 2024 16:53:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:953b1b38-ae0d-400e-9b2e-14989cf75312</guid><dc:creator>nickk1385</dc:creator><description>&lt;p&gt;So those also suggest a plugin which I cannot do.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to check if documents exist?</title><link>https://community.appian.com/thread/134637?ContentTypeID=1</link><pubDate>Thu, 02 May 2024 22:19:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ffcf5a88-c116-4ae3-bcbd-18ea4246d602</guid><dc:creator>Mathieu Drouin</dc:creator><description>&lt;p&gt;Multiple threads on this topic:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;&lt;a href="/discussions/f/general/27886/check-if-a-document-exists-in-appian/130025"&gt;https://community.appian.com/discussions/f/general/27886/check-if-a-document-exists-in-appian/130025&lt;/a&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;a href="/discussions/f/rules/34730/document-exists-or-not"&gt;https://community.appian.com/discussions/f/rules/34730/document-exists-or-not&lt;/a&gt;&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>