You've correctly identified the likely root cause: the field locationname
(from the related location
entity) is not directly available on the Participation
entity from which your email is being sent. The fact that Level-up shows the formatted value in _location_value@OData.Community.Display.V1.FormattedValue
confirms this.
Here's a breakdown of why this happens and how to solve it within your Power Automate flow and Dynamics 365 email template:
Understanding the Data Structure:
Participation
entity.location
information is stored in a separate entity (let's assume it's called Location
).Participation
entity) that links a Participation
record to a specific Location
record. This lookup field will have a schema name like _location_value
.{!location:locationname;}
in your email template, Dynamics 365 tries to directly access a field named locationname
on the Participation
entity, which doesn't exist.Solution: Accessing Related Entity Attributes in Power Automate
You need to explicitly retrieve the related Location
record within your Power Automate flow to access its locationname
attribute. Here's how you can modify your flow:
Participation
record that triggers the email. Ensure this action includes the lookup field to the Location
entity (e.g., _location_value
).Participation
record, add a new action: "Get record".Location
entity (the actual schema name of your Location entity).Location
record from the Participation
record. You can get this using dynamic content from the previous "Get record" (Participation) action. Look for the _location_value
output. This field contains the GUID of the linked Location
record.
Participation
record but also from the "Get record (Location)" action you just added.locationname
attribute within the dynamic content of the "Get record (Location)" action.{!location:locationname;}
, you need to reference the locationname
attribute from the related Location
entity that you are now explicitly retrieving in your Power Automate flow.Here are a couple of common approaches:
Location
record. You might need to pass the locationname
as a separate dynamic property from your flow.SendEmailFromTemplate
action. This allows you to pass a JSON object containing the Participation
record and the retrieved Location
record (including the locationname
). You can then reference these parameters in your email template using a specific syntax (often involving the parameter name and the attribute).Example using "Perform a bound action" (assuming the email is related to the Participation record):
participations
(your Participation entity schema name)Microsoft.Dynamics.CRM.SendEmailFromTemplate
relatedData
): Enter a name for your parameter.{
"participation": @{outputs('Get_the_participation_record')},
"location": @{outputs('Get_record_(Location)')}
}
relatedData
parameter. The exact syntax depends on the Dynamics 365 version and how the template rendering engine handles custom parameters. It might look something like:
{{relatedData.location.locationname}}
or a similar dot-notation based access. You might need to experiment or consult Dynamics 365 documentation for the precise syntax for accessing custom parameters in email templates.
Using the Formatted Value (Less Ideal for Direct Use):
While you see the formatted value in _location_value@OData.Community.Display.V1.FormattedValue
, this is primarily for display purposes and might not be directly usable as a value in your email content. It's a string representation of the lookup value (likely the name of the location). The more reliable way is to fetch the actual Location
record and use its attributes.
In summary, the solution involves:
Location
record in your Power Automate flow.locationname
attribute from the retrieved Location
record to your email template (either implicitly if the template context allows or explicitly as a parameter).locationname
from the related Location
data.The "Perform a bound action" with a custom parameter is generally the most robust and flexible way to pass related data to email templates in Power Automate. Remember to test your flow and email template thoroughly after making these changes.
André Arnaud de Cal...
294,261
Super User 2025 Season 1
Martin Dráb
233,013
Most Valuable Professional
nmaenpaa
101,158
Moderator