Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Insert good ‘morning/evening’ into email

(0) ShareShare
ReportReport
Posted on by 77
Hi all, Wondering how I can automatically insert greeting into email based on time of day. Have no idea on what the expression would look like and or the flow. Maybe using utcNow() to determine current time and cross match that against a condition. Cheers, Gerard
  • LegionsMan Profile Picture
    2 on at
    Re: Insert good ‘morning/evening’ into email

    Hi. I've never used Power Automate before, but this is something I desperately need with the amount of emails I send. Is there a detailed, step-by-step to achieve this desired outcome? Will this also take hold in the Outlook 365 Desktop application? 

  • Gerard2 Profile Picture
    77 on at
    Re: Insert good ‘morning/evening’ into email
    It worked - thank you so much Bof. Sorry for the slow reply - couldn’t respond to thread on my phone, The only thing I am trying to fix now is formatting. In the email ‘Good morning’ appears but when I draw in the persons name using dynamic content I get the following ‘Good morning Person , As you can see a space has been added between person and the commanand I’m not sure how to remove it. I am using HTML to format the email. In the body of the email using HTML and dynamic content I have the following; Fxif(...)[PERSON],

    The comma is right next to person but it always adds a space - any idea on how to remove the space? Cheers, Gerard

  • Verified answer
    v-bofeng-msft Profile Picture
    on at
    Re: Insert good ‘morning/evening’ into email

    Hi  @Gerard2 :
    Has the problem been solved?
    Is there anything else I can help?
    If my post helps, then please consider Accept it as the solution to help others.Thanks
    Best Regards,
    Bof

  • Gerard2 Profile Picture
    77 on at
    Re: Insert good ‘morning/evening’ into email

    Thanks Bof - very much appreciated.

    I’ll give it a go tomorrow and post the results.

     

    Cheers,

     

    Gerard

     

     

  • Verified answer
    v-bofeng-msft Profile Picture
    on at
    Re: Insert good ‘morning/evening’ into email

    Hi @Gerard2 :

    Please try this:

    11.gif1.JPG

    The Result

    2.JPG

    Best Regards,

    Bof

  • Gerard2 Profile Picture
    77 on at
    Re: Insert good ‘morning/evening’ into email

    Hi Bof,


    Australian Eastern Standard Time UTC +11.

     

    My flow is 

     

    • When an item or file is modified
    • Get changes for an item or file (properties only) 
    • Condition ( Has Column Changed: Column XYZ - equals true
    • If Yes 
    • Send an email ( Good morning/ evening DisplayName - PERSON has completed form - please review when ready)

    Can I just plonk that expression into my ‘Send an email’ connector - I’m using dynamic content to fill out details like PERSON etc and I’m using HTML formatting.

     

    Thanks so much.

     

    Gerard

  • v-bofeng-msft Profile Picture
    on at
    Re: Insert good ‘morning/evening’ into email

    Hi @Gerard2 :

    Could you tell me:

    What time zone are you in?

    I assume you use UCT time then please try this flow:

    v-bofeng-msft_0-1606980319162.jpeg

     

    Reference Expression:

    if(greater(int(formatDateTime(utcNow(),'HH')),18),'Good evening',if(greater(int(formatDateTime(utcNow(),'HH')),11),'Good Afternoon','Good Morning'))

    If you are in another time zone, just add the offset value. I assume you are in the UCT+8 time zone

    The expression should be:

    if(greater(int(formatDateTime(addHours(utcNow(),8),'HH')),18),'Good evening',if(greater(int(formatDateTime(addHours(utcNow(),8),'HH')),11),'Good Afternoon','Good Morning'))

    Best Regards,

    Bof

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork 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 > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1