I'm trying to get details for the "Relationship Manager" from the systemuser table which is linked to the Account, which in turn, is linked to the logged in user (Logged in User -> Account -> Relationship Manager)
When I try to get the systemuser details for a specific id with the following code it works:
{% assign entity_logical_name = 'systemuser' %}
{% assign contact = entities[entity_logical_name]['01334e8c-6013-ed11-b83f-002248ae4598'] %}
{% if contact %}
{{ contact.fullname | escape }}
{% endif %}
The problem is that I need to get the id from the account entity linked to the logged in user.
So I wrote the following code:
{% if user %}
{% assign account = entities.account[user.parentcustomerid.Id] %}
{% if account %}
{% assign relate_id = account.relationshipmanager.Id%}
Print RM Id: '{{relate_id}}'
{% assign entity_logical_name = 'systemuser' %}
{% assign contact = entities[entity_logical_name][relate_id] %}
{% if contact %}
{{ contact.fullname | escape }}
{% endif %}
{% endif %}
{% endif %}The line where I print the RM Id my output shows what I expect: the ID of the item. But using that dynamic relate_id doesn't work.
I have tried a few different syntax approaches - not of which worked:
{% assign contact = entities[entity_logical_name][relate_id] %}
{% assign contact = entities[entity_logical_name]['relate_id'] %}
{% assign contact = entities[entity_logical_name][{{relate_id}}] %}
{% assign contact = entities[entity_logical_name]['{{relate_id}}'] %}
{% assign contact = entities[entity_logical_name][account.relationshipmanager.Id] %}
Please help me figure out what I'm doing wrong.