cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Fish_mm
Regular Visitor

Get DayOfWeek from DateTimeReceived when new emails arrives

Hi All,

 

Anyone can help me on below?

 

I want to set a condition where 

if DateTimeReceived is equal to 6 (or Saturday)

Forward email to specified email address. 

 

How should i set the if DateTimeReceived is equal to 6 (or Saturday)?

 

i try with 

Compose

DayOfWeek(triggerbody()?['DateTimeReceived'])

but return this is not valid expression.

22 REPLIES 22

Many thanks for your help on this, it is much appreciated. I am not clear as to what the Compose formula should be. Below is the original formula, that returned (3):

 

dayOfWeek(formatDateTime(triggerbody() ['cr0ad_referraldate'],'D'))

 

The following if the revised Compose formula (I have changed the Referral Date to Friday's date in the Case):

 

dayOfWeek(formatDateTime(triggerbody() ['cr0ad_referraldate'],'dddd'))

 

This formula is returning an error message:

 

Compose Failed.PNG

 

Have I got the Compose expression wrong?

 

Also, what should the condition expression be, once the Compose function returns the alphabetic value for day of the week?

Output Condition.PNG

 Chris

If you want the name of the day as output then you don't need the DayOfTheWeek() function around the outside anymore.  DayOfTheWeek() returns the number of the day, but you want the name.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Many thanks on this. I have it working correctly now.

Have a good weekend.

Chris

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (5,989)