title: How to add a filter in react-admin List populated by unique values within the list?
body: <p>Probably a newbie question, but can't quite connect the dots. I have a filter component in a List:</p>
  
  <pre><code>const BrandFilter = (props) =&gt; (
      &lt;Filter {...props}&gt;
        &lt;SearchInput source="q" alwaysOn /&gt;
        &lt;RadioButtonGroupInput source="active" alwaysOn label="" choices={[
          { id: 'true', name: 'Active' },
          { id: 'false', name: 'Inactive' },
          { id: ' ', name: 'All' },
        ]} /&gt;
        &lt;QuickFilter source="pursue" label="Pursue" resettable /&gt;
        &lt;SelectInput label="Status" source="status" optionText="status" /&gt;
      &lt;/Filter&gt;
    );
  </code></pre>
  
  <p>The SelectInput doesn't show anything in the dropdown list. Not sure if it's possible but I'd like to show a dropdown list with unique status values that appear in the records. Status does not have an FK relationship; its just a text field that anything can be entered into. But, I'd still like the user to be able to see the values in the dropdown and select one. Possible? Thanks.</p>
  
  <p>UPDATE</p>
  
  <p>I tried to add a unique list of statuses as a reference record by modifying the api to accept a new end point: /brands/statuses and returning a unique list of statuses. It did work in populating the Status dropdown list. </p>
  
  <p>App.js:</p>
  
  <pre><code>&lt;Resource
    name="brands/statuses" /&gt;
  </code></pre>
  
  <p>Brand.js (Filter component)</p>
  
  <pre><code>  &lt;ReferenceInput source="status" reference="brands/statuses" perPage={25}&gt;
      &lt;SelectInput label="Status" source="status" optionText="status" /&gt;
    &lt;/ReferenceInput&gt;
  </code></pre>
  
  <p>However, I got an error that at least one record didn't have an id. I remembered that react expects records to have an id. So, as a hack, I added the id of the first brand record to the sql:</p>
  
  <pre><code>SELECT fpb.id, fpb.status FROM lookabout.fgm_product_brand fpb WHERE fpb.status IS NOT NULL GROUP BY fpb.status ORDER BY fpb.status
  </code></pre>
  
  <p>That resulted in getting a list of statuses in the filter dropdown. However, when I clicked on one of them, it sent the id of the status (which was actually just the id of a brand record) and returned no results:</p>
  
  <pre><code>http://localhost:3010/brands/find?limit=15&amp;page=1&amp;orderBy=id&amp;orderDir=ASC&amp;filter={%22active%22:%22%20%22,%22status%22:2}
  </code></pre>
  
  <p>Close, but not quite. I feel I'm forcing something because I'm not quite getting it. Or, working against how react-admin was meant to operate?? Any suggestions would be welcome. Thanks.</p>
  
  <p>FINAL UPDATE</p>
  
  <p>Got it to work. Rather than use the id of the brand record as a substitute status id, I just used the status itself. So, the sql in the api now reads:</p>
  
  <pre><code>SELECT fpb.status AS id, fpb.status FROM lookabout.fgm_product_brand fpb WHERE fpb.status IS NOT NULL GROUP BY fpb.status ORDER BY fpb.status
  </code></pre>
  
  <p>That gives the result set an id that is unique and that is then used in when passing the filter criteria. The HTTP GET request now looks like:</p>
  
  <pre><code>http://localhost:3010/brands/find?limit=15&amp;page=1&amp;orderBy=id&amp;orderDir=ASC&amp;filter={%22active%22:%22%20%22,%22status%22:%22Potential%22}
  </code></pre>
  
  <p>And that returns the expected results. Thanks to all for your help.</p>