If I’m finding all the entries that are related to a user, how could I get the field handle that the found user is referenced from?
{% set events = craft.entries.section('events').relatedTo(user) %}
{% for event in events %}
{# What goes here? Hypothetical code based on non-existent method would be: #}
{% set field = craft.fields.relatedTo(user) %}
{{ field.title }}
{# Obviously this isn't possible. Any way to accomplish something like this? #}
{% endfor %}
There are multiple users fields in the found entries, and there will be different logic depending on which field the user is found.