<?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 use the a constant to create a document link?</title><link>https://community.appian.com/discussions/f/new-to-appian/37747/how-to-use-the-a-constant-to-create-a-document-link</link><description>Hello, 
 
 I am trying to add a document link to an interface. I found the a!documentDownloadLink function and it tells me to create a constant to point to my documents but I am a bit lost. 
 This is an interface where a supervisor will approve or deny</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: how to use the a constant to create a document link?</title><link>https://community.appian.com/thread/141814?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2024 15:51:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3d984294-2a16-4524-9e78-498e690f1394</guid><dc:creator>gabrield295009</dc:creator><description>&lt;p&gt;Thanks Mike, I&amp;#39;ll give it a try.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use the a constant to create a document link?</title><link>https://community.appian.com/thread/141805?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2024 14:37:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8967cf90-696f-4be2-a38a-ef447a92546c</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;One nitpick / advice here - I never recommend anyone use &lt;em&gt;a!linkField()&lt;/em&gt; at all for any reason, now that we have &lt;em&gt;&lt;strong&gt;a!richTextDisplayField()&lt;/strong&gt;&lt;/em&gt;.&amp;nbsp; The latter makes it more easy and flexible to control the link, what it displays, and when to display it.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;{
  a!richTextDisplayField(
    label: &amp;quot;Download document&amp;quot;,
    value: {
      a!richTextItem(
        text: {
          &amp;quot;Click Here to Download &amp;quot;, /* whatever label you want */
          a!richTextIcon(icon: &amp;quot;file-export&amp;quot;)
        },
        link: a!documentDownloadLink(
          /*label: &amp;quot;&amp;quot; */  /* &amp;quot;label&amp;quot; component is not used in this context - the rich text item&amp;#39;s text is sufficient */
          document: 123, /* Your document id here */
          showWhen: true() /* add conditionality here to turn the link &amp;quot;on&amp;quot; or &amp;quot;off&amp;quot; as needed */
        )
      )
    }
  )
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Plus, we get rich text formatting options including icons, links that can be on individual words in the middle of a longer string, etc.&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/62/pastedimage1729175893144v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use the a constant to create a document link?</title><link>https://community.appian.com/thread/141803?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2024 14:15:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2463762c-6525-46fe-a622-fc3bdff833b7</guid><dc:creator>gabrield295009</dc:creator><description>&lt;p&gt;Yeah, you are right I was not doing it properly. Thanks! Thank you &amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use the a constant to create a document link?</title><link>https://community.appian.com/thread/141801?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2024 14:04:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:38ae6d2d-32bc-4064-9353-6ab0f0d31b78</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;What is wrong with Shubham&amp;#39;s original answer?&amp;nbsp; This should be correct.&lt;/p&gt;
[quote userid="276123" url="~/discussions/f/new-to-appian/37747/how-to-use-the-a-constant-to-create-a-document-link/141790"]If document id stored in DB and document id exist in appian simply use document id from record.[/quote]&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use the a constant to create a document link?</title><link>https://community.appian.com/thread/141799?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2024 13:56:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:18e85a30-a228-4252-8936-8cbd19b6f363</guid><dc:creator>gabrield295009</dc:creator><description>&lt;p&gt;Yup sorry, long day. I have a record action where a user submits a form that can include attachaments. That form should be later evaluated by a supervisor.&lt;/p&gt;
&lt;p&gt;I want the information from the record action to be displayed in the supervisor interface, including a link to the attachments. I can display all other information but I do not know how to dislpay a link to the attachments.&lt;/p&gt;
&lt;p&gt;The attachments are store to my documents folder through a file upload input and attached to my record type through a field called &amp;quot;documentacion&amp;quot; of Number(integer) type.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;how can i display the link?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use the a constant to create a document link?</title><link>https://community.appian.com/thread/141797?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2024 13:44:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:59ecdd12-809b-4ea0-8f47-271c10709a31</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="292577" url="~/discussions/f/new-to-appian/37747/how-to-use-the-a-constant-to-create-a-document-link/141796"] that value should match the form being evaluated at the moment[/quote]
&lt;p&gt;it&amp;#39;s unclear what you&amp;#39;re actually saying here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use the a constant to create a document link?</title><link>https://community.appian.com/thread/141796?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2024 13:39:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e06ef476-99ee-4f57-9ead-6b7eca19d4c1</guid><dc:creator>gabrield295009</dc:creator><description>&lt;p&gt;Yes I need to provide a document link from the DB but that value should match the form being evaluated at the moment. &amp;nbsp;am sorry if I am not explaining myself correctly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use the a constant to create a document link?</title><link>https://community.appian.com/thread/141793?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2024 12:12:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2d9cf3d4-0d30-4005-bd08-db67114d7d3c</guid><dc:creator>Shubham Aware</dc:creator><description>&lt;p&gt;Bit confused.&lt;br /&gt;Correct me here: You just need to provide the document link for the document whose ID is coming from the database?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use the a constant to create a document link?</title><link>https://community.appian.com/thread/141792?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2024 11:51:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:78e2d7f3-a82b-442a-b947-04ed325eae32</guid><dc:creator>gabrield295009</dc:creator><description>&lt;p&gt;There is a document id and it is store on the DB but the document shown needs to match the current information that is being reviewed. T&lt;/p&gt;
&lt;p&gt;he idea is that someone will have a review request and all the pertinent information will pop up, including the documents attached to that specific request.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use the a constant to create a document link?</title><link>https://community.appian.com/thread/141791?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2024 11:47:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d50da807-4557-446c-b9a5-27615a35f0b6</guid><dc:creator>Yogi Patel</dc:creator><description>&lt;p&gt;You can create a constant of &amp;quot;Document&amp;quot; type:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/62/pastedimage1729165616019v1.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use the a constant to create a document link?</title><link>https://community.appian.com/thread/141790?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2024 11:47:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:63b3e838-8b44-4a53-967c-31a17d913789</guid><dc:creator>Shubham Aware</dc:creator><description>&lt;p&gt;I don&amp;#39;t see that constant is required for&amp;nbsp;&lt;span&gt;a!documentDownloadLink()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If document id stored in DB and document id exist in appian simply use document id from record. use below code to understand more.&lt;/p&gt;
&lt;pre&gt;&lt;pre class="ui-code" data-mode="text"&gt;{
  a!linkField(
    label: &amp;quot;Download document&amp;quot;,
    labelPosition: &amp;quot;ABOVE&amp;quot;,
    links: {
      a!documentDownloadLink(
        label: document(
          documentId:{}, /*Add your document id here from record.*/ 
          property: &amp;quot;name&amp;quot;
        ),
        document: {} /*Add your document id here record.*/
      )
    }
  )
}&lt;/pre&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>