D9.3. All fields are not referenced, they are just simple integers. All data was pulled from a huge external API and it was not possible to create all references.

Just for ease of understanding, imagine a book database website with books and characters. But each character is presented in one book only.

So, book node has field_book_id, which is numeric, unique, but not NID. Also it has a multiple field_character_ids with a list of ids of all characters in this book.

A character node has its own field_character_id (matching with field_character_ids from book node). And also field_my_book_id, which equals to book id field.

The goal is to create a View, which will show the current book's characters in a list.

I'm using Views Contextual Filter Default Entity Field Values module which allows to pull fields values from the current node, for example.

But in Views Filter Criteria I can't match the selected field with the value from the Contextual Filter. It has only pre-defined operators, such as is equal to, is less than, is greater than, etc. And I can't select something like "Match value from contextual filter". I tried to use twig and replacement patterns there without any luck.

It would be a very simple database query, but is it possible to get it working in Views?

1 Answer 1


Ok, it was rather simple.

In contextual filter add the field you want to target.

Then: When the filter value is NOT available > Provide default value > Field value from current entity > under Entity Field select field which will filter the view results.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.