<?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>hardcode values in paragraph field</title><link>https://community.appian.com/discussions/f/user-interface/29385/hardcode-values-in-paragraph-field</link><description>Hi, 
 I have a paragraph field. I need to hardcode a value, with the below code, the user can change the value. When I used the a!richtextdisplayfield, I was getting an error. 
 Can someone pls guide here. 
 a!paragraphField( label: &amp;quot;Rejection Comment</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: hardcode values in paragraph field</title><link>https://community.appian.com/thread/116421?ContentTypeID=1</link><pubDate>Tue, 18 Jul 2023 15:31:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d6987884-6968-445f-8cb4-8cbf83db6ed1</guid><dc:creator>hema.mathivathanan</dc:creator><description>&lt;p&gt;Thanks, I will use the value in the &amp;quot;submit&amp;quot; button&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hardcode values in paragraph field</title><link>https://community.appian.com/thread/116420?ContentTypeID=1</link><pubDate>Tue, 18 Jul 2023 15:29:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d2d90e98-8bc1-480b-ac8a-d9efd8b0f73c</guid><dc:creator>juergeng0002</dc:creator><description>&lt;p&gt;Of course!&lt;br /&gt;It is a question of logic - If there is something already in the field, you don&amp;#39;t add the word &amp;#39;Rejection&amp;#39; Only the first time.&lt;br /&gt;You have to replace the value expression with this one:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt; value: if(a!isNullOrEmpty(local!comment),&amp;quot;REJECTION &amp;quot; &amp;amp; local!comment,local!comment),&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hardcode values in paragraph field</title><link>https://community.appian.com/thread/116419?ContentTypeID=1</link><pubDate>Tue, 18 Jul 2023 15:24:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:48cb9a21-d0e2-41d4-b615-7e85c2884b09</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Yeah, i&amp;#39;ll echo what Stefan said - you can manipulate the value of the user-entered text however you want AFTER the user is done with it.&amp;nbsp; You don&amp;#39;t NEED to have that extra text sitting inside the text entry box during user entry.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;a!buttonWidget(&lt;br /&gt;&amp;nbsp;label: &amp;quot;Submit&amp;quot;,&amp;nbsp; /* for example */&lt;br /&gt;&amp;nbsp;submit: true(),&lt;br /&gt;&amp;nbsp;saveInto: {&lt;br /&gt;&amp;nbsp;&amp;nbsp; ri!buttonClicked, /* for example */&lt;br /&gt;&amp;nbsp;&amp;nbsp; a!save(ri!rejectionComment, &amp;quot;REJECTION &amp;quot; &amp;amp; local!comment)&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hardcode values in paragraph field</title><link>https://community.appian.com/thread/116417?ContentTypeID=1</link><pubDate>Tue, 18 Jul 2023 15:22:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:17988d88-f1ec-40e5-9cd0-d135ed89fdd0</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Why not just add that word on submit?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hardcode values in paragraph field</title><link>https://community.appian.com/thread/116415?ContentTypeID=1</link><pubDate>Tue, 18 Jul 2023 15:20:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:816a9671-8072-4b9d-97c2-70f0b28d5208</guid><dc:creator>hema.mathivathanan</dc:creator><description>&lt;p&gt;It&amp;#39;s a requirement where we have &amp;quot;Rejection&amp;quot; followed by where the user can enter text. If I give value: &amp;quot;rejection&amp;quot; &amp;amp; local!comment, the user can delete the word &amp;quot;Rejection&amp;quot; or make changes to it. But, I need it to stay the same.&lt;/p&gt;
&lt;p&gt;Do we have a way to do it&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hardcode values in paragraph field</title><link>https://community.appian.com/thread/116414?ContentTypeID=1</link><pubDate>Tue, 18 Jul 2023 15:11:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:645313ba-1ab4-4c29-bb95-d63bb46fe5cd</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="154541" url="~/discussions/f/user-interface/29385/hardcode-values-in-paragraph-field"]When I used the a!richtextdisplayfield[/quote]
&lt;p&gt;because a!richTextDisplayField() is a read-only component.&lt;/p&gt;
[quote userid="154541" url="~/discussions/f/user-interface/29385/hardcode-values-in-paragraph-field"]value: &amp;quot;REJECTION &amp;quot; &amp;amp; local!comment,[/quote]
&lt;p&gt;So if you were trying to make it a READ-ONLY paragraph field, this would be an OK way to DISPLAY the value.&amp;nbsp; However it&amp;#39;s a bit more tricky if you want the text to show up in the field as a default but then save only the user input that follows that value - because, when &amp;quot;REJECTION &amp;quot; is included in the &amp;quot;value&amp;quot; field, that text populates into the user entry, and then it flows to the saveInto when the user changes the value of the field, so any time the user touches it, it&amp;#39;ll save a redundant &amp;quot;REJECTION &amp;quot; at the front of the message.&lt;/p&gt;
&lt;p&gt;There are ways around this involving manual work inside the saving, but honestly I fear it&amp;#39;s just going to cause more confusion.&lt;/p&gt;
&lt;p&gt;This makes me ask though, why the redundant &amp;quot;REJECTION&amp;quot; label *&lt;strong&gt;inside&lt;/strong&gt;* the field value?&amp;nbsp; What&amp;#39;s wrong with using the... &amp;quot;label&amp;quot; as the label?&amp;nbsp; What value does it add to have the word again?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hardcode values in paragraph field</title><link>https://community.appian.com/thread/116413?ContentTypeID=1</link><pubDate>Tue, 18 Jul 2023 15:11:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:959854c3-ffc4-4803-8f4d-e78435bf4869</guid><dc:creator>juergeng0002</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;br /&gt;not sure what you are trying to accomplish. The issue with the above approach is, every time the user is interacting with the field, the word &amp;#39;Rejection&amp;#39; will be added to the content of the field.&lt;/p&gt;
&lt;p&gt;I see no issue with&amp;nbsp;a rich text display field.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!comment,
  {
    a!paragraphField(
      label: &amp;quot;Rejection Comment&amp;quot;,
      value: &amp;quot;REJECTION &amp;quot; &amp;amp; local!comment,
      saveInto: local!comment,
      
    ),
    a!richTextDisplayField(
      label: &amp;quot;Rich Text Display Field &amp;quot;,
      value: a!richTextItem(
        text: &amp;quot;REJECTION &amp;quot; &amp;amp; local!comment,
        style: &amp;quot;EMPHASIS&amp;quot;,
        size: &amp;quot;MEDIUM_PLUS&amp;quot;,
        color: &amp;quot;ACCENT&amp;quot;
      )
    )
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>