<?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>Retrieving a specific document in PM based on its name</title><link>https://community.appian.com/discussions/f/process/30055/retrieving-a-specific-document-in-pm-based-on-its-name</link><description>Hi all, 
 I&amp;#39;m a bit unfamiliar on how can I search for a document based on its name to send it on an email? right now of course doing it manually works but I was wondering if there is a function that returns the document based on its name or anything</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Retrieving a specific document in PM based on its name</title><link>https://community.appian.com/thread/119426?ContentTypeID=1</link><pubDate>Mon, 18 Sep 2023 20:49:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b08c7c6f-09f8-4711-930f-71aecb9f4aed</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;You don&amp;#39;t even need todocument - the &amp;quot;document&amp;quot; object type is just a wrapper for the document ID (which is just an integer) - you can freely typecast from one to the other.&amp;nbsp; So if you look up your document ID from the DB (by any of a hundred different standard methods), you can just save it into a PV of type &amp;quot;document&amp;quot; and use that for whatever you&amp;#39;d want.&amp;nbsp; (It could even be a PV of type integer instead, though in your process instance you&amp;#39;d just see the ID instead of the document name etc.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retrieving a specific document in PM based on its name</title><link>https://community.appian.com/thread/119425?ContentTypeID=1</link><pubDate>Mon, 18 Sep 2023 20:46:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0f8754e2-f00d-4f30-9134-a95d522a9a42</guid><dc:creator>Maria</dc:creator><description>&lt;p&gt;In that case, if I save the documentId to my database table.&amp;nbsp;I could use the todocument function to retrieve the document in my process model correct?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retrieving a specific document in PM based on its name</title><link>https://community.appian.com/thread/119424?ContentTypeID=1</link><pubDate>Mon, 18 Sep 2023 20:31:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:261b177c-a3ab-40e0-b5d1-d828b039f90f</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;You should definitely be saving the document ID in your database table, not the filename.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retrieving a specific document in PM based on its name</title><link>https://community.appian.com/thread/119423?ContentTypeID=1</link><pubDate>Mon, 18 Sep 2023 20:29:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f17ee7f1-5684-4d7b-aa43-cb99c7c67dd8</guid><dc:creator>Maria</dc:creator><description>&lt;p&gt;I see, thank you for your response! in terms of my use case is more of each record of a table has a document that belongs to it, it needs to be sent when the user performs a record action, so I was looking for a way to pull that specific document from the folder depending on the name since in my table I have the name saved. so basically for example my record type is employee and the documentname&amp;nbsp;is a field in this table. I can easily reference the name based on the selected record.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retrieving a specific document in PM based on its name</title><link>https://community.appian.com/thread/119422?ContentTypeID=1</link><pubDate>Mon, 18 Sep 2023 20:21:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4fdda3de-79ae-4f57-b46e-630fd2d459da</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;You can use the Content Tools plug-in and its built-in functions like &amp;quot;find content by attribute&amp;quot; which allows you to supply criteria to search such as the name, root folder, type (in this case &amp;quot;document&amp;quot;).&amp;nbsp; Note that Appian has no requirement that files in any folder have unique names, so you will always need to take further steps to ensure you&amp;#39;re pulling back only one result.&amp;nbsp; Generally if you&amp;#39;re trying to reference a static file within a process, though, it is recommended to create a constant that points to that file, then reference the constant in your process.&amp;nbsp; I don&amp;#39;t know enough about your use case in this situation to really say much either way about it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>