title: Store Text into an Scalar within If / Else Statement - Robot Framework
body: <p>I want to accomplish the following into Robot Framework</p>
  <p>I want to store a Text from an Element <code>xpath://*[@id=&quot;plsAttachGrid_0_1&quot;]</code>into a Scalar <code>${name3}</code>, however, the Element is not always available on the web page, therefore, I need to run a IF/ELSE statement in order to avoid an Error when the Element is not available</p>
  <p>My idea was the following:</p>
  <pre><code>${countt2}=    Get Element Count    xpath://*[@id=&quot;plsAttachGrid_0_1&quot;]
  Run Keyword If    ${countt2}&gt;0    
  ${name3}=    Get Text    xpath://*[@id=&quot;plsAttachGrid_0_1&quot;]
  ELSE    LOG    NO_FILE
  </code></pre>
  <p>However, I have learnt It is not possible to store into a Scalar inside <code>Run Keyword If</code>, since it is expecting  a <code>Keyword</code>.</p>
  <p>Therefore, how can I accomplish it?</p>