<?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>Rule to calculate length of String</title><link>https://community.appian.com/discussions/f/new-to-appian/34496/rule-to-calculate-length-of-string</link><description>rule to calculate length of a string. if the length of string exceeds 50, then show the access text with (...more.) else returns the sring.</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Rule to calculate length of String</title><link>https://community.appian.com/thread/131998?ContentTypeID=1</link><pubDate>Thu, 28 Mar 2024 02:42:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:169227f7-eab1-4509-a211-6d4fd95a89f6</guid><dc:creator>Karumuru Abhishek</dc:creator><description>&lt;p&gt;Hi &lt;a href="/members/adityap0026"&gt;adityap0026&lt;/a&gt;&amp;nbsp; you find the logic directly in the patterns tab in interface design tab, you can change the logic as per your requirement&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/pastedimage1711593704910v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Rule to calculate length of String</title><link>https://community.appian.com/thread/131995?ContentTypeID=1</link><pubDate>Wed, 27 Mar 2024 22:14:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:40937e12-0894-4732-ad1a-90c3766f66ac</guid><dc:creator>Konduru Chaitanya</dc:creator><description>&lt;p&gt;A sample code to acheive that. Just replace the data&amp;nbsp; and limit with rule inputs and you can re-use.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!data: &amp;quot;A good example of a paragraph contains a topic sentence, details and a conclusion. &amp;#39;There are many different kinds of animals that live in China. Tigers and leopards are animals that live in China&amp;#39;s forests in the north. In the jungles, monkeys swing in the trees and elephants walk through the brush. There are camels in the deserts in China that people use for transportation. Lots of different kinds of animals make their home in China&amp;quot;,
  a!richTextDisplayField(
    value: {
      a!localVariables(
        local!showMore: false,
        {
          a!richTextItem(
            text: if(
              local!showMore,
              local!data,
              left(local!data, 50)
            )
          ),
          char(32),
          a!richTextItem(
            link: a!dynamicLink(
              value: if(local!showMore, false, true),
              saveInto: local!showMore
            ),
            text: if(local!showMore, &amp;quot;..less&amp;quot;, &amp;quot;..more&amp;quot;),
            showWhen: len(local!data) &amp;gt; 50
          )
        }
      )
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Rule to calculate length of String</title><link>https://community.appian.com/thread/131992?ContentTypeID=1</link><pubDate>Wed, 27 Mar 2024 21:35:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:05a9f13a-17ee-4c37-9cbe-72a2f42cfd58</guid><dc:creator>David Jimenez </dc:creator><description>&lt;p&gt;Use this code....&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  
  local!text: &amp;quot; The local variable to use when evaluating the given expression. Use the &amp;#39;local!&amp;#39; domain to define and reference individual variables. By default, a local variable will automatically update when any variables it references are changed. To change the way variables are updated, use the a!refreshVariable() function. Variables can be refreshed under the following conditions: after each reevaluation, periodically on an interval, or when other variables change.&amp;quot;,
  
  local!result:if(
    condition: len(local!text)&amp;gt;50,
    valueIfTrue: concat({left(local!text, 50),  &amp;quot; (more...)&amp;quot;}),
    valueIfFalse: local!text
  ),
  
  local!result
  
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Rule to calculate length of String</title><link>https://community.appian.com/thread/131986?ContentTypeID=1</link><pubDate>Wed, 27 Mar 2024 19:50:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5d7f56bb-73e5-40fc-91a8-5d2d9afb0378</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;&lt;a id="" href="https://docs.appian.com/suite/help/24.1/Appian_Functions.html"&gt;https://docs.appian.com/suite/help/24.1/Appian_Functions.html&lt;/a&gt;&amp;nbsp; -&amp;gt; &amp;quot;text&amp;quot;&lt;/p&gt;
&lt;p&gt;The standard primitive function for text length is simply &amp;quot;&lt;em&gt;&lt;strong&gt;len()&lt;/strong&gt;&lt;/em&gt;&amp;quot;.&lt;/p&gt;
&lt;p&gt;For read-only text displays with such a length cut-off, you can simply use the Rich Text Display Field and in cases where the length is greater than 50, show the &lt;em&gt;&lt;strong&gt;left(&amp;quot;my text&amp;quot;, 50)&lt;/strong&gt;&lt;/em&gt; characters of it, then &amp;quot;(more)&amp;quot; - what&amp;#39;s better, with the Rich Text Display Field you can then make just the &amp;quot;(more)&amp;quot; tag clickable and expand the displayed text to show the entire thing.&amp;nbsp; I&amp;#39;ve used this trick in grids where a column has text that sometimes gets too long for comfortable display by-defult.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>