<?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>Logic - do not display if value is empty</title><link>https://community.appian.com/discussions/f/user-interface/35214/logic---do-not-display-if-value-is-empty</link><description>In my gridColum, I am displaying an email link, with an envelope-o icon. 
 However, if the value of the field is empty or null, it&amp;#39;s still displaying the icon. 
 How do I add the if logic to this code to not display the icon if the value of the field</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Logic - do not display if value is empty</title><link>https://community.appian.com/thread/136804?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2024 19:03:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a9866c3d-3809-4870-b147-e5a9f46035a6</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="261749" url="~/discussions/f/user-interface/35214/logic---do-not-display-if-value-is-empty/136803"]I&amp;#39;m still a N00b at writing expressions, but I&amp;#39;m learning the ways of SAIL.[/quote]
&lt;p&gt;been there - it&amp;#39;s rewarding once you can get your head around the seemingly weird structure required.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Logic - do not display if value is empty</title><link>https://community.appian.com/thread/136803?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2024 17:48:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d68a7c86-18e8-4d8b-9bd3-3a3b9db89e63</guid><dc:creator>Scott Fleming</dc:creator><description>&lt;p&gt;Thank you for your assistance! I&amp;#39;m still a N00b at writing expressions, but I&amp;#39;m learning the ways of SAIL.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Logic - do not display if value is empty</title><link>https://community.appian.com/thread/136800?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2024 16:13:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5cebf925-7eae-483a-9abd-de0418ecf75d</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;cool - appreciate any &amp;quot;verify answer&amp;quot;s you are available to dish out too, lol.&amp;nbsp; also make sure you don&amp;#39;t miss my last reply in the thread above, i gave you a final implementation to try out in your case (plus or minus adjusting certain names etc).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Logic - do not display if value is empty</title><link>https://community.appian.com/thread/136796?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2024 16:02:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:aa7615ff-f2af-4613-bb9d-47a81ed854ef</guid><dc:creator>Yogi Patel</dc:creator><description>&lt;p&gt;OK. Thanks for the suggestion.&lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f44d_2D00_1f3fb.svg" title="Thumbsup tone1"&gt;&amp;#x1f44d;&amp;#x1f3fb;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Logic - do not display if value is empty</title><link>https://community.appian.com/thread/136787?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2024 15:44:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cdf5e6fa-1850-4058-a95a-77fdea1e429d</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Given that, you would re-write your original column value to something more like this, assuming we call the above expression rule &amp;quot;&lt;strong&gt;&lt;em&gt;rule!GLBL_parseEmail()&lt;/em&gt;&lt;/strong&gt;&amp;quot; for example:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!richTextDisplayField(
  value: a!localVariables(
    local!emailMap: rule!GLBL_parseEmail(emailString: fv!row[&amp;#39;recordType!POC etc&amp;#39;]),
    {
      a!richTextItem(
        showWhen: a!isNotNullOrEmpty(local!emailMap.email),
        text: {
          a!richTextIcon(
            icon: &amp;quot;envelope-o&amp;quot;
          ),
          local!emailMap.name
        },
        link: a!safeLink(
          uri: &amp;quot;mailto://&amp;quot; &amp;amp; local!emailMap.email
        ),
        linkStyle: &amp;quot;STANDALONE&amp;quot;
      ),
      
      a!richTextItem(
        showWhen: a!isNullOrEmpty(local!emailMap.email),
        text: &amp;quot;(none)&amp;quot;,
        size: &amp;quot;SMALL&amp;quot;,
        style: &amp;quot;EMPHASIS&amp;quot;,
        color: &amp;quot;SECONDARY&amp;quot;
      )
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Logic - do not display if value is empty</title><link>https://community.appian.com/thread/136786?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2024 15:44:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:03a8c6e4-1e0e-44fc-b7a7-8f93f0b31af4</guid><dc:creator>Scott Fleming</dc:creator><description>&lt;p&gt;Great advice. I will create the rule and call it instead. I agree, I don&amp;#39;t like all this business happening at the rendering level.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Logic - do not display if value is empty</title><link>https://community.appian.com/thread/136785?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2024 15:39:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5ffe0029-fba2-4a2c-8862-86dbabcd2924</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Here&amp;#39;s an expression rule I just whipped up that will extract the name and email, presuming the formatting is exactly on-spec and no funny business has happened with special characters.&amp;nbsp; Note that &lt;em&gt;extract()&lt;/em&gt; returns an array, so we have to take care to cast that as a singular result (my favorite way is just to take the first index() of the result).&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!localVariables(
  local!name: index(extract(
    &amp;quot;--beginning--&amp;quot; &amp;amp; ri!emailString,
    &amp;quot;ng--&amp;quot;,
    &amp;quot; &amp;lt;&amp;quot;
  ), 1, null()),
  
  local!email: index(extract(
    ri!emailString,
    &amp;quot;&amp;lt;&amp;quot;,
    &amp;quot;&amp;gt;&amp;quot;
  ), 1, null()),
  
  
  a!map(
    name: local!name,
    email: local!email
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Logic - do not display if value is empty</title><link>https://community.appian.com/thread/136782?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2024 15:29:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2a206b67-c097-4d2b-9e56-3c06dffbdfbf</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;You really, really, really ought to consider moving this parser to its own expression rule.&amp;nbsp; Trying to have this code hard-coded into a grid like this just makes stuff un-readable, and then of course when you get little errors like this it&amp;#39;s also very hard to test.&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/13/pastedimage1718206138705v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Logic - do not display if value is empty</title><link>https://community.appian.com/thread/136781?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2024 15:28:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6a3fe992-762c-4ddc-b64e-059b6bdcc026</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;No answer to your question, but instead of constantly parsing this weird email address format when using it, I suggest to do that once when storing it to the database.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Logic - do not display if value is empty</title><link>https://community.appian.com/thread/136780?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2024 15:27:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f35b93c1-e8a9-4a2e-b2fd-d46c67090f43</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;I would suggest putting the showWhen condition in the RichTextItem object actually - the richTextDisplayField still needs to show up (afaik) so the column has some content, even if it&amp;#39;s blank.&amp;nbsp; additionally my normal trick here would be to add one extra RichTextItem to the displayField&amp;#39;s array, set to show ONLY when the email is blank, in which case i show like &amp;quot;&lt;span style="color:#999999;font-size:75%;"&gt;&lt;em&gt;(none)&lt;/em&gt;&lt;/span&gt;&amp;quot; using nice richText formatting also.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Logic - do not display if value is empty</title><link>https://community.appian.com/thread/136776?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2024 15:13:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:df4b8b86-451c-4789-bd52-99e0beadf23a</guid><dc:creator>Yogi Patel</dc:creator><description>&lt;p&gt;&lt;span&gt;Add showhen condition in a!richTextDisplayField.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!richTextDisplayField(
  value: {
    a!richTextItem(
    )
  },
  showWhen: a!isNotNullOrEmpty(fv!row[&amp;#39;recordType!technicalPointOfContact&amp;#39;])
)&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Logic - do not display if value is empty</title><link>https://community.appian.com/thread/136767?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2024 14:54:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c7b5ae1d-af2f-4497-89f8-16dc463adc33</guid><dc:creator>David Jimenez </dc:creator><description>&lt;p&gt;From &amp;quot;extract&amp;quot; the rule is wrong...and that makes the compiler throws the Syntax error&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/13/pastedimage1718204065206v1.png" /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What do you want to do with that instruction?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>