cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gerard2
Helper I
Helper I

Insert good ‘morning/evening’ into email

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
2 ACCEPTED SOLUTIONS

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @Gerard2 :

Please try this:

11.gif1.JPG

The Result

2.JPG

Best Regards,

Bof

View solution in original post

v-bofeng-msft
Community Support
Community Support

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

View solution in original post

6 REPLIES 6
v-bofeng-msft
Community Support
Community Support

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

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
Community Support
Community Support

Hi @Gerard2 :

Please try this:

11.gif1.JPG

The Result

2.JPG

Best Regards,

Bof

View solution in original post

Gerard2
Helper I
Helper I

Thanks Bof - very much appreciated.

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

 

Cheers,

 

Gerard

 

 

v-bofeng-msft
Community Support
Community Support

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

View solution in original post

Gerard2
Helper I
Helper I

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

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (3,587)