title: How to create a step definition to handle dynamic data entry?
body: <p>I've searched a bit for this but can't find an exact example.  I have a form to fill in as a step.  The form fields look something like this:</p>
  
  <p>Date:<br>
  Currency:<br>
  Total:<br>
  Description:  </p>
  
  <p>But not all of the fields are required to have data entered by the user.  Instead of writing several methods to account for the different combinations, like so:</p>
  
  <pre><code>(When I enter the 'Date' and 'Currency' and 'Total' and 'Description')  
  (When I enter the 'Date' and 'Total')  
  (When I enter the 'Currency' and 'Description')  
  etc...
  </code></pre>
  
  <p>I'd like to somehow implement something like this, instead, in the feature file:  </p>
  
  <pre><code>When I enter the following details:  
    |Date        |x    |       
    |Currency    |USD  |  
    |Total       |100  |   
    |Description |Test |  
  </code></pre>
  
  <p>And then have a single method to handle any combination of data the user enters in that second column.  </p>
  
  <p>I've found sites that have this data table-driven example:</p>
  
  <pre><code>When I enter the following details:  
    |Date        |&lt;date&gt;        |       
    |Currency    |&lt;currency&gt;    |  
    |Total       |&lt;total&gt;       |   
    |Description |&lt;description&gt; |  
  
  Example data:
    |date |currency |total |description |  
    |x    |USD      |100   |foo         |
    |y    |EUR      |200   |test        |
    |z    |HKD      |124   |bar         |
  </code></pre>
  
  <p>But that's not what I am after.  I don't need to iterate through a list of predetermined example data.  I hope I've summarized the problem clearly enough and someone knows a good place to go find an example of this kind of implementation.  Thanks for any advice!</p>