title: How to store the user selected value from API response in a variable
body: <p>User inputs a company's ID number and it will return them a list of addresses that belong to that company split in 3 objects (street, zip code, city).</p>
  <p>When they click on one of those addresses, I want the 3 elements of the selected address to be stored in the postData() function:</p>
  <pre><code>&lt;template&gt;
      &lt;div&gt;
        &lt;v-card-text&gt;
          &lt;v-row v-if=&quot;ask_id&quot;&gt;
            &lt;v-text-field label=&quot;Enter the id_number&quot; v-model=&quot;id_number&quot;&gt;&lt;/v-text-field&gt;
            &lt;v-btn 
            @click=&quot;
            send_id_number();
            show_results()&quot;&gt;
            &lt;/v-btn&gt;
          &lt;/v-row&gt;
          &lt;v-row v-else&gt;
            &lt;v-select v-model=&quot;res_data&quot;
            :items=&quot;filteredData&quot; label=&quot;Places&quot; :item-text=&quot;
            (item) =&gt; item.street + item.zip_code + item.city&quot;&gt;
            &lt;/v-select&gt;
          &lt;/v-row&gt;
        &lt;/v-card-text&gt;
      &lt;/div&gt;
    &lt;/template&gt;
    
    &lt;script&gt;
    import axios from 'axios';
    
    export default {
      props: [&quot;id&quot;],
      data() {
        return {
          ask_id: true,
          id_number: null,
          res_object: [],
          res_data: [],
          places: []
        };
      },
      computed: {
          filteredData() {
          return this.res_object.places
            ? this.res_object.places.filter((g) =&gt; {
              return g.places_closed == false;
            })
            : [];
        },
        postData() {
          let data = {
              selected_street: this.?,
              selected_zip: this.?,
              selected_city: this.?,
              id_number: this.?
          }
          return data
        }
      },
      methods: {
        show_results() {
        this.mode = false
        },
        send_id_number() {
          axios.get(`https://api.places_url.com/${this.id_number}`)
          .then((response) =&gt; {
            this.res_object = response.data
          })
          .catch((err) =&gt; {
            console.log(err)
          })
        }
      },
    };
    &lt;/script&gt;
  </code></pre>
  <p>However whatever I try to do tells me <code>TypeError: undefined is not an object</code>. I'm missing a step but I'm not sure what it is.</p>
  <p>structure of the api response:</p>
  <pre><code>{
      &quot;company_id&quot;: 123456789,
      &quot;places&quot;:[
          {&quot;street&quot;:&quot;8 main street&quot;,
          &quot;zip_code&quot;:&quot;303&quot;,
          &quot;city&quot;:&quot;RandomCity&quot;,
          &quot;places_closed&quot;:false
          },
          {&quot;street&quot;:&quot;10 main street&quot;,
          &quot;zip_code&quot;:&quot;404&quot;,
          &quot;city&quot;:&quot;RandomCity&quot;,
          &quot;places_closed&quot;:false
          },
          {&quot;street&quot;:&quot;11 main street&quot;,
          &quot;zip_code&quot;:&quot;505&quot;,
          &quot;city&quot;:&quot;RandomCity&quot;,
          &quot;places_closed&quot;:false
          }
      ]
  }
  </code></pre>