<?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>Using a rule with an if statement</title><link>https://community.appian.com/discussions/f/process/13802/using-a-rule-with-an-if-statement</link><description>I have a rule that uses an if statement similar to the example below: 
 
 if(ri!firstName=&amp;quot;John&amp;quot;, &amp;quot;Manager&amp;quot;, if(ri!firstName=&amp;quot;Mary&amp;quot;,&amp;quot;CEO&amp;quot;, if(ri!firstName=&amp;quot;Bob&amp;quot;,&amp;quot;VP&amp;quot;,&amp;quot;&amp;quot;))) 
 
 The only problem is that if a person is not John, Mary, or Bob, I do no want</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Using a rule with an if statement</title><link>https://community.appian.com/thread/62676?ContentTypeID=1</link><pubDate>Wed, 14 Nov 2018 23:47:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:10cd4daf-39fd-46c5-a2bc-714a8c32ba96</guid><dc:creator>aloks0189</dc:creator><description>&lt;p&gt;Hi Tony,&lt;/p&gt;
&lt;p&gt;How about using the below mentioned code snippet:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;if(
  ri!firstName = &amp;quot;John&amp;quot;,
  &amp;quot;Manager&amp;quot;,
  if(
    ri!firstName = &amp;quot;Mary&amp;quot;,
    &amp;quot;CEO&amp;quot;,
    if(
      ri!firstName = &amp;quot;Bob&amp;quot;,
      &amp;quot;VP&amp;quot;,
      ri!firstName
    )
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;As per this above snippet, if&amp;nbsp;ri!firstName is not in (John, Mary and Bob) then instead of setting null/{}/&amp;quot;&amp;quot; and loosing the input value, you can return the same input value i.e.&amp;nbsp;ri!firstName.&lt;/p&gt;
&lt;p&gt;I am not sure whether are you looking for the same sort of solution or not, but in this case, when you navigate to the previous page, then you will have the same value as what you have provided and not in (John, Mary and Bob). And also, if you are using conditional statement means, you are supposed to store a value in either case, either it can be a null or a value.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using a rule with an if statement</title><link>https://community.appian.com/thread/62652?ContentTypeID=1</link><pubDate>Wed, 14 Nov 2018 17:23:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fc76a833-39db-4aa3-a16a-c815733e22b9</guid><dc:creator>Mike Schmitt</dc:creator><description>What is the result of the IF statement currently being stored into?  It sounds (just guessing) like you&amp;#39;re storing it into a separate filed i.e. ri!position, in which case it sounds as if you would probably just want to keep the current value of ri!position (instead of empty string) in the final &amp;quot;else&amp;quot; case.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>