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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to remove spaces b...
Power Automate
Answered

How to remove spaces before and after dynamic content (formatdate)

(0) ShareShare
ReportReport
Posted on by 17

Hi, I faced an issue whereby there seems to be a <br> in front and behind a dynamic content that is created from formatdate (as highlighted in yellow) .

 

salmonsushi_0-1679933318089.png

 

I tried trimming and using compose but the spaces are still there.

salmonsushi_1-1679933402040.png

 

Alternatively, I tried using concat to join all my email body and the dynamic content (formatdate) but there is no difference.

salmonsushi_2-1679933489776.png

 

The dates has to be dynamic as it will change every month. Hence I divided the email template into 3 segments, and insert the dynamic content in there.

Categories:
I have the same question (0)
  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @salmonsushi 

     

    Could you post a screenshot of the variable 'current month' mapping?

  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @salmonsushi 

     

    Try this expression

     

    split(variables('Current_Month'),decodeUriComponent('%0A'))?[0]
     
    Thanks
  • salmonsushi Profile Picture
    17 on at

    salmonsushi_0-1679967815353.png

     

  • salmonsushi Profile Picture
    17 on at

    @abm I have amend but it remains the same.

     

    When I look at the output in html, this is what I observed:

     

    <span style="color&#58;rgb(50, 49, 48);font-size&#58;14px;"><br>Jak</span></div>

    </div>March 2023<div class="ExternalClass0F385871DFE74D63B899B78150C014C1">

    <div style="font-family&#58;Calibri, Arial, Helvetica, sans-serif;font-size&#58;11pt;color&#58;rgb(0, 0, 0);"><span style="color&#58;black;"> dobiegła końca, prosimy o przesłanie nam e-mailem

     

    I'm not proficient in html. But it seems like the </div> is causing the spaces before and after the dynamic content "Current_Month"

  • salmonsushi Profile Picture
    17 on at

    Adding on the other method that I have tried but still no difference:

     

    Html to text -> Compose

    salmonsushi_0-1679969329695.png

    salmonsushi_1-1679969348721.png

     

     

  • Verified answer
    salmonsushi Profile Picture
    17 on at

    I managed to solve it by using replace function.

     

    In the email content, to type 'MMM_YYYY' that requires dynamic reference.

    Use replace function to search for strings within email content that has 'MMM_YYYY', and replace it with Current_Month variable

     

    salmonsushi_0-1679980746089.png

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard