title: Google sheet script - Filtering unique cell values - Pushing 2D array values into a single cell
body: <p>sorry to disturb again but I'm getting my head off..
  I just want to filter unique strings that are in each cell of a range (strings are separated by semicolons)
  I can't push all the array values, only one is getting out of results.
  Thanks a lot !</p>
  
  <p>Here is an example : <a href="https://docs.google.com/spreadsheets/d/12T5K9LovcFvmeBg82IS89p4ygtZ530mzpY9fIsZQa8w/edit?usp=sharing" rel="nofollow noreferrer">https://docs.google.com/spreadsheets/d/12T5K9LovcFvmeBg82IS89p4ygtZ530mzpY9fIsZQa8w/edit?usp=sharing</a>
  PS : I'm using script because they are too many strings in each cell for spliting cell by formula</p>
  
  <p>Here's my coding :</p>
  
  <pre><code>function FilterReferences(){
  
    var classeur = SpreadsheetApp.getActive();
    var feuille = classeur.getSheetByName('Feuille 1');
    var plage = feuille.getRange('A1:A');
    var plageValues = plage.getValues();
    var NbLignesTotal = plage.getLastRow();
  
    for (var i = 1; i &lt; NbLignesTotal; i++){
      try {
         var valeurCellule = plageValues[i-1][0];
          if (valeurCellule != ""){
            var source = valeurCellule.split(";");
            var dest = [];
            dest.push(source[0]);
  
            for (var n = 0 ; n &lt; source.length ; n++){
            if (dest.indexOf(source[n]) == -1){  dest.push(source[n])};   }
  
  
          var plageDest = feuille.getRange('B1:B');
          plageDest.getCell(i,1).setValue([dest]);
  
       }
      } catch (e) {   }
   }
  }
  </code></pre>