<?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>Search a text from sentence</title><link>https://community.appian.com/discussions/f/rules/24242/search-a-text-from-sentence</link><description>Hello All, 
 
 My requirement is to search a word from the sentence. 
 for example: sentence(single text): &amp;quot;The document is AI contain the data&amp;quot; 
 search text :&amp;quot;AI&amp;quot; 
 Output: true 
 The desired result is:- get that the sentence is having the search text</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Search a text from sentence</title><link>https://community.appian.com/thread/93532?ContentTypeID=1</link><pubDate>Tue, 12 Apr 2022 12:57:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:15d942a4-07f4-4898-84b3-1f2efd8b1f27</guid><dc:creator>Peter Lewis</dc:creator><description>&lt;p&gt;Because you want to explicitly find if the object is a word (not letters within another word), I don&amp;#39;t think you can directly use find / search / substitute. Instead, I&amp;#39;d recommend splitting all the words in your sentence by a space and then comparing each word individually. Here&amp;#39;s an example:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!sentence: &amp;quot;The document is AI and contains the data&amp;quot;,
  or(
    a!forEach(
      items: split(local!sentence, &amp;quot; &amp;quot;),
      expression: fv!item = &amp;quot;AI&amp;quot;
    )
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Depending on what you expect your text input to be, you might need other logic as well. For instance, if you expect to receive multiple sentences or punctuation, I&amp;#39;d also recommend stripping out all of the punctuation before doing the check using the stripwith() function.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Search a text from sentence</title><link>https://community.appian.com/thread/93508?ContentTypeID=1</link><pubDate>Tue, 12 Apr 2022 05:56:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e9905063-4ba2-456a-bd8b-0c9e7c72d038</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;I highly recommend to become familiar with the Appian function library.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/22.1/Appian_Functions.html"&gt;docs.appian.com/.../Appian_Functions.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Search a text from sentence</title><link>https://community.appian.com/thread/93504?ContentTypeID=1</link><pubDate>Tue, 12 Apr 2022 04:38:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e72dddc9-5126-4e4c-969d-82e42ad57671</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;You can use the substitute method. Use to substitute the desired searchText and then compare the length of the old and new string.&amp;nbsp;&lt;br /&gt;If the text was found, then the length of the string will be reduced by searchText characters.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Search a text from sentence</title><link>https://community.appian.com/thread/93503?ContentTypeID=1</link><pubDate>Tue, 12 Apr 2022 04:37:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6b748e8a-a42a-4b58-9273-c83d9b442922</guid><dc:creator>GopalK</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a class="internal-link view-user-profile" href="/members/sahilb0004"&gt;sahilb0004&lt;/a&gt;, You can use find() or search() function to check if a word is there or not in your text and then add a condition to get the boolean value. find or search function gives you the index of the word you are searching in the text string. so if you get 0 as a result then it means the word you searched is not available hence you can get output as false and if it gives any non zero integer , it means you found the word in your text string. See below example.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!position:find(&amp;quot;AI&amp;quot;,&amp;quot;The document is AI contain the data&amp;quot;,),
  if(
    local!position=0,
    false,
    true
  )
)
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>