title: How can I store a selectInput in a vector?
body: <p>I'm trying to save a selectInput in a vector.</p>
  
  <p>In my UI I've got:</p>
  
  <pre><code>selectInput("my_ID", "Search for a name", unique(datatable$names), "Henry")
  </code></pre>
  
  <p>In my server, I want to save this input in a variable to use it later.</p>
  
  <p>This is basically what I want:</p>
  
  <pre><code>selectedNames &lt;- input$my_ID
  </code></pre>
  
  <p>Of course, this does not work.
  So I tried this:</p>
  
  <pre><code>selectedNames &lt;- reactive(input$my_ID)
  </code></pre>
  
  <p>But I get this warning again:</p>
  
  <blockquote>
    <p>Error in .getReactiveEnvironment()$currentContext() :    Operation not
    allowed without an active reactive context. (You tried to do something
    that can only be done from inside a reactive expression or observer.)</p>
  </blockquote>
  
  <p>I have also tried to do it with an observer and different chunks of code I found on the internet, but nothing worked.</p>
  
  <p>At the end, I want to use the selectedNames is a filter like this:</p>
  
  <pre><code>example &lt;- datatable %&gt;% filter(names %in% selectedNames())
  </code></pre>
  
  <p>How can I fix this?</p>