Trying to use variable to pass a view argument/parameter I'm currently in the middle of trying to figure out a way to pass the value from a variable to be used as parameter/argument for my drupal view.

I have a contextual filter that currently configured on my drupal view to output only nodes based on the taxonomy term/ID. Instead of explicitly manually setting the parameters below. 

{{drupal_view('view_one', 'block_1', 212, 210)}}


Is there a way I could use a variable to pass the parameters to my drupal view

 % for tags in node.field_filter_tags %}

    {% set tagid = tags.entity.id %}

{% endfor %}

{{drupal_view('view_one', 'block_1', tagid)}}


I tried it but it seems to show duplicates.
the first you install module Twig Tweak

In file yourtheme.theme

/**
 * Implements hook_preprocess_HOOK() 
 */
function yourtheme_preprocess_node(&amp;$variables) {
  $terms=[];
  foreach($variables['node']-&gt;field_tags-&gt;getValue() as $term){
    $terms[] = $term['target_id'];
  }
  $variables['node_terms'] = implode(',',$terms);
}


In file node.html.twig

{{ drupal_view('custom_view','article_block',node_terms) }}


Config Views CONTEXTUAL FILTERS in your views