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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Attempting to forward ...
Power Automate
Unanswered

Attempting to forward emails after regular business hours

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello all,

 

I'm attempting to forward emails after regular business hours. I'm currently encountering an issue setting up the condition to check when an email enters a shared mailbox. This is my current setup:

Afterhoursissue.png

Here is a better look at the code within the condition block:

substring(triggerBody()?['DateTimeReceived'],11,8)
 
What I'm trying to accomplish with this is to pull the time from the 'DateTimeReceived' value from the output above. Then I compare it to the time format to the right. If it's greater than '18:00:00' or less than '05:30:00' the condition should trigger. However I get this error message below:

 

 

InvalidTemplate. Unable to process template language expressions for action 'Condition' at line '1' and column '15169': 'The template language function 'substring' expects its first parameter 'string' to be a string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#substring for usage details.'.

 

 

Could someone help explain to me what I'm doing wrong? 

Categories:
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @Anonymous 

     

    Can you try updating the expression to: 

     

    substring(triggerOutputs()?['body/receivedDateTime'],11,8)

     

    And remove the single quotes from the strings in the right side of the condition and try? 

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 317 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 247

#3
Henil Profile Picture

Henil 117

Last 30 days Overall leaderboard