web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
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. 
  • ShaileshJain Profile Picture
    Microsoft Employee on at

    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?

  • piffie Profile Picture
    5 on at

    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.

  • Suggested answer
    ShravanSuri Profile Picture
    1,255 on at

    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

    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.

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

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daniyal Khaleel Profile Picture

Daniyal Khaleel 87 Most Valuable Professional

#2
11manish Profile Picture

11manish 69 Super User 2026 Season 2

#3
Syed Aqib Raza Profile Picture

Syed Aqib Raza 48

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans