Using view result as an input filter for another view Let me explain my scenario at first.

I have two content types in my site.

First is products and second is producer.

Each product has only one producer and each producer has one or more products.

Now in every product page, I want to show the producer information. I made a view block for this issue and it works well.

but in the product page, I also have a plan to show all products of the producer of current product in another block.

In order to show the product nodes of a specific producer I need the node ID of producer content type.

I tried to use Contextual filters --- Provide default value "When the filter value is NOT available" via Content ID from URL but this function returns node ID of current product not producer id. (because we are in a specific page of single product) 

Now I am searching to find a solution for this issue.

thanks a lot for your guidance.
Say, the term reference field in the product content type is called "field_ref_producer". You need to have this block of code, and a view that accepts a contextual filter for "term reference producer ID" ready.Let this view be called "other_products_producer"

$node = menu_get_object();
$output = '';
if(is_object($node)) {
  $producer_id = $node-&gt;field_ref_producer['und'][0]['tid'];
  $output = views_embed_view('other_products_producer', 'default',$producer_id);
}
echo $output;


Basic idea is, grab the node object from URL, get the producer tid from it and then embed a view passing the producer nid as contextual filter to the view. 

Update:

Code to put in views PHP (default value of contextual filter):

$node = menu_get_object();
if(is_object($node)) {
  $producer_id = $node-&gt;field_ref_producer['und'][0]['tid'];
  return $producer_id;
}


Please replace the name of the field to what you have in  your content type.