title: How do I grab all the unique values in a fetch request?
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>async function fetchTemplates() {
      let seturl = `https://wax.api.atomicassets.io/atomicassets/v1/templates?collection_name=mlb.topps&amp;schema_name=series1}&amp;has_assets=true&amp;page=1&amp;limit=3414&amp;order=desc&amp;sort=created`;
      
      try {
          let res = await fetch(seturl);
          return await res.json();
      } catch (error) {
          console.log(error);
      }
  
  }
  
  async function renderFilterVariants(arg) {
      let sets = await fetchTemplates();
      console.log(sets);
  
      if( !Array.isArray( sets.data ) )
      {
          throw new Error( "atts.data is not an array." );
      }
  
      const team  = sets.data.map( d =&gt; d.immutable_data.${arg});
      console.log(team);
      
  }
  
  renderFilterVariants(cardid);</code></pre>
  </div>
  </div>
  </p>
  <p>Why doesn't this work? I want the function to be able to pass a custom variation under d.immutable_data</p>
  <p><a href="https://i.stack.imgur.com/93UCC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/93UCC.png" alt="enter image description here" /></a></p>
  <p>It has to be dynamic as the variations under immutable_data is different depending on page.</p>
  <p><a href="https://i.stack.imgur.com/RAIBo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RAIBo.png" alt="enter image description here" /></a></p>