Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Email Template Formatting issues

(1) ShareShare
ReportReport
Posted on by 6
Hello! 
 
I created a list of fields in which one of them is a choice (Yes/No), if it is a Yes, it will fill a field next to it with a predetermined value but if its no, it will be clear.
 
The issue is when i pulled the field on an Email Template, the fields that is empty will have a gap there.
 
I was wondering if there was a solution to this or is there another way to create this solution in a different way to not have the missing gaps?
 
Thanks
Categories:
  • JA-11021511-0 Profile Picture
    6 on at
    Email Template Formatting issues
    Thank you for the answer!
     
    Is there a resource or a tutorial for the Power Automate method?
     
    What I am following is that:
     
    -> Have a section in the Email Template to be filled by Power Automate
     
    -> Power Automate fills the missing fields 
     
    -> Email Template pulls from PA?
     
    Is that right?
  • Tom_Gioielli Profile Picture
    918 on at
    Email Template Formatting issues
    Got it, we are talking about a full carriage return rather than spacing between words.
     
    Unfortunately, I am not aware of any way to dynamically show or hide a row like you have below in the D365 email templates, short of inserting the carriage return into your string, Alternatively, you could create a new text area field for your email body and populate it using Power Automate which would give you much more flexibility. Then you can pull that whole text block into your email template.
     
    It's not a great solution, but I'm not aware of another way.
  • JA-11021511-0 Profile Picture
    6 on at
    Email Template Formatting issues
     
    I have attached an example of the email template.
     
    Basically, the email template pulls the field from an Opportunity.
     
    There's a Business Process Rule that dictates to fill up the field with a predetermined text or clears it.
     
    What I wanted it to do is to not have that field show up in the email with the gaps where the fields are supposed to be.
  • Suggested answer
    Tom_Gioielli Profile Picture
    918 on at
    Email Template Formatting issues
    If the issue is that the email template has essentially two spaces, you could try building one of the spaces into your predetermined value. In the rest of this answer, I will be using the dash (-) character to represent a blank space.
     
    For example, if we have the word "Super" in our custom field and then build out a sentence (no spacing before or after the word)
     
    When word is present: "This-pizza-tastes-super-good"
    When word is blank: "This-pizza-tastes--good"
     
    When the email template includes the space before and after your word, and the word is empty, the template is filling in two spaces. If instead, your custom field has "super-" with the space at the end of it you get the following:
     
    When word is present: "This-pizza-tastes-super-good"
    When word is blank: "This-pizza-tastes-good"
     
    In our second scenario, because we are storing the space after our word everything still works as expected even if it is not present. Important to note that this fix is very specific to your issue of the email template, and adding a space to the end of your word could cause other issues that I'm not aware of.
     
    If this helped, please consider marking the answer as verified.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,304 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans