title: How to iterate through 2 DataSources in SoapUI Pro
body: <p><strong>Goal:</strong> Iterate through 2 DataSources to update the properties in the "Assert Properties are Equal" Groovy script.</p>
  
  <p><strong>Problem:</strong> Test case is only iterating through the rows in the "GetAppointmentInfo-> Properties" DataSource.  The properties from the "Stratus_ODS-> Properties" DataSource are stuck on the first row of the datasource and not updated as the test case loops.</p>
  
  <p>Image of test Case here (sorry, needed 10 rep to put image inline):
  <a href="http://imgur.com/DYMbIf3" rel="nofollow">http://imgur.com/DYMbIf3</a></p>
  
  <p><strong>Test Case Steps and description:</strong></p>
  
  <ol>
  <li><p>REST Request "Start Get Key" - responds with security key required for 2nd request</p></li>
  <li><p>Property Transfer "Key -> GetAppointmentInfo" - transfers security key to GetAppointmentInfo Request</p></li>
  <li><p>REST Request "GetAppointmentInfo" - responds with list of appointments in XML</p></li>
  <li><p>DataSource "GetAppointmentInfo -> Properties" - Source "GetAppointmentInfo" response, stores a column of Appointment Numbers as a property named "ApptNum".  The appointment numbers are [100,101,102,103,104]</p></li>
  <li><p>DataSource "Stratus_ODS -> Properties" - Source is table in SQL Server Database, stores a column of Appointment Numbers as a property named "SQL_ApptNum".  The appointment numbers are [100,101,102,103,104]</p></li>
  <li><p>Groovy Script Step "Assert Properties are Equal"</p>
  
  <pre><code>def ApptNum = context.expand( '${GetAppointmentInfo-&gt;Properties#ApptNum}' )
  def SQL_ApptNum = context.expand( '${Stratus_ODS-&gt;Properties#SQL_ApptNum}' )
  assert ApptNum == SQL_AptNum
  </code></pre></li>
  <li><p>DataSource Loop - Source: Step 4 "GetAppointmentInfo -> Properties" &amp; Target:  Step 6 "Assert Properties are Equal"</p></li>
  </ol>
  
  <p><strong>Assertion passes on first iteration when:</strong> </p>
  
  <p>ApptNum =100  &amp;  SQL_ApptNum = 100</p>
  
  <p><strong>Assertion fails on second iteration when:</strong></p>
  
  <p>ApptNum =101  &amp;  SQL_ApptNum = 100</p>