Home Forums General Issues Filter Relationship Field Query Reply To: Filter Relationship Field Query

  • There isn’t anything that will allow you to filter a relationship field based on a selection made in another field. The value of the other field is not available for the acf/fields/relationship/query/ filter, it is not supplied by ACF when it runs the AJAX request to get the posts.

    There are a couple of possibilities.

    1) is that you must save the post before you can filter based on this other field. Then in your filter that you posted above

    'value' => get_field('filter_field_name', $post_id)

    2) Do not use a relationship field and switch to a select field and add custom JavaScript and your own AJAX query to get the posts. There are some examples of this here