title: Run Keyword If key exists in dictionary (Robot Framework)
body: <p>I am currently using Robot Framework to automate tests for a form. To feed the form data I am using dictionaries like these:</p>
  
  <pre class="lang-py prettyprint-override"><code>*** Variables ***
  &amp;{TestCase1}    key1=a    key2=b    key3=c    key4=d
  &amp;{TestCase2}    key2=x    key3=y
  </code></pre>
  
  <p>What I am trying to do is condition the filling of certain fields on if the matching key exists in the dictionary for that test case, so that optional fields can be left blank. I tried running the the following keyword:</p>
  
  <pre class="lang-py prettyprint-override"><code>*** Keywords ***
  Fill Form
      [Arguments]    &amp;{TestCase}
      Run Keyword If    &amp;{TestCase}[key1]    Input Text    id=field1    &amp;{TestCase}[key1]
      Run Keyword If    &amp;{TestCase}[key2]    Input Text    id=field2    &amp;{TestCase}[key2]
      Run Keyword If    &amp;{TestCase}[key3]    Input Text    id=field3    &amp;{TestCase}[key3]
      Run Keyword If    &amp;{TestCase}[key4]    Input Text    id=field4    &amp;{TestCase}[key4]
  </code></pre>
  
  <p>...but to no avail. I'm getting this error:</p>
  
  <pre><code>FAIL: Dictionary &amp;{TestCase} has no key 'key1'.
  </code></pre>
  
  <p>...which makes sense to some extent, because it doesn't, but that was the point. I expected this to make the condition evaluate to False and make RF skip the keyword.</p>
  
  <p>Can anyone explain why it doesn't work that way and if there is another way to make this happen? Any help is greatly appreciated!</p>