Query Entries based on current Entry's related Entries I'm wanting to show related articles based on the current article's related Markets.

How do I get the current markets and filter relevant posts based on those related markets? This is what I have so far but doesn't seem correct.

{% set allMarkets = entry.relatedMarkets.all() %}
{% set currentID = entry.id %}

{# Get Related Articles Based on Markets #}
{% set expertBlog = craft.entries()
    .section('blog')
    .orderBy('postDate desc')
    .expertOpinion(true)
    .relatedMarkets([allMarkets])
    .id(['not', currentID])
    .limit(3) %}

      &lt;h3 class="f3-l f3-xl fw5 mt0-l mt0-xl b tc"&gt;Enjoyed this article? Keep reading more expert insights...&lt;/h3&gt;
      &lt;div class="flex flex-wrap cf mb4 nl3-m nr3-m nl3-l nr3-l nl3-xl nr3-xl"&gt;
          {% cache %}
          {% for entry in expertBlog %}
              {% set columns = 'w-100 w-50-m w-33-l w-33-xl' %}
              {% include "_partials/lists/blog/_cards_blog_article_authors_expert.twig" %}
          {% endfor %}
          {% endcache %}
      &lt;/div&gt;
You're close!

In your entry query, change .relatedMarkets([allMarkets]) to .relatedTo(allMarkets) (use relatedTo instead and you don't need array brackets).

Final code looks like:

{% set allMarkets = entry.relatedMarkets.all() %}
{% set currentID = entry.id %}

{% set expertBlog = craft.entries()
    .section('blog')
    .orderBy('postDate desc')
    .expertOpinion(true)
    .relatedTo(allMarkets)
    .id(['not', currentID])
    .limit(3)
%}