Skip to main content
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Resolve a custom entity in a each loop

(0) ShareShare
ReportReport
Posted on by 5

Hi,

i know this is actually really basic, but it seems somehow i cannot resolve a custom entity in a foreach loop.

I want to get out all the sessions a person is registred with and send it to him, so a rather basic feature. but somehow i allways get a InvalidToken exception.

Here is my code:

    {{msevtmgt_session(ce85e211-66bb-ea11-a812-000d3a654ce0).msevtmgt_name}} {{#each contact.msevtmgt_sessionregistration_contact_msevtmgt_contactid}}
  • {{msevtmgt_session(this.msevtmgt_sessionid).msevtmgt_name}} {{this.msevtmgt_sessionid}}
  • {{/each}}
it seems as if resolving a entity does not work with a variable, but only with text. 
  • piffie Profile Picture
    5 on at
    RE: Resolve a custom entity in a each loop

    Hey Shavan,

    Actually there is a field in the session registration that should contain the session name, but it seems that microsoft left it blank when making a new session registration.

    I can make an workaround in filling it with a custom workflow, but i believe it rather should be done correctly by microsoft.

    do you think it would be useful to open a ticket here?

    thanks for the workaround answer.

  • Suggested answer
    ShravanSuri Profile Picture
    1,255 on at
    RE: Resolve a custom entity in a each loop

    Hey! 

    Couple of points here:

    1. Passing references into a #each loop is not supported.
    2. You can:
      1. Add the fields from the session you want to be added in the email (like session name) into the session registration record (add new fields and actually put the value in, rather than making them calculated fields)
      2. Loop through all session registrations for the contact and based on the event that email is about, put in the details of the corresponding sessions

        
        
      3. {{this.session_name}}

    I understand that the process is a bit involved (with the extending the session registration entity and copying some data, but this should get you unblocked.

    Thanks,

    Shravan

    PM, D365 Marketing

  • piffie Profile Picture
    5 on at
    RE: Resolve a custom entity in a each loop

    Hi Shailesh,

    Yes. for all the Sessions a person registered for.

    As we have a strict policy that you only can enter these sessions, and sponsors can nominate people in advance it is important to tell them where they will have access to.

    thanks.

  • ShaileshJain Profile Picture
    on at
    RE: Resolve a custom entity in a each loop

    Hi Christoph - can you please confirm what is the business scenario here:

    Seem like, you are trying to compose an email with list of all events the recipient has registered for?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Now Available: 2025 Release Wave 2

Quick Links

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Holly Huffman Profile Picture

Holly Huffman 103

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 96 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 51 Most Valuable Professional

Product updates

Dynamics 365 release plans