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 / Send auto-replies to s...
Power Automate
Unanswered

Send auto-replies to senders when a new email arrives after office hours not working

(1) ShareShare
ReportReport
Posted on by 932 Super User 2024 Season 1

I am using the 'Send auto-replies to senders when a new email arrives after office hours' template. When I run the flow. I get the following error:

 

The value of first parameter is of type 'Null' but the function 'substring' expects a string.

 Here is what I have:

HamidBee_0-1666695008720.png

 

Thanks in advance. 

 

Categories:
I have the same question (0)
  • srduval Profile Picture
    1,760 Moderator on at

    Sounds like it doesn't like something in your substring. Can you post that expresssion

  • HamidBee Profile Picture
    932 Super User 2024 Season 1 on at

    Just a note, I made no changes to the template. The expression is:

     

    substring(triggerBody()?['DateTimeReceived'], 11, 8 )

     

     

     

     

  • Ellis Karim Profile Picture
    11,793 Super User 2025 Season 2 on at

    You could get the integer value for the hour, then perform a check so see if it's between, say 9 and 17 for office hours:

    int(formatDateTime(triggerOutputs()?['body/receivedDateTime'],'HH'))


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

  • VictorIvanidze Profile Picture
    13,079 on at

    Use this:

    substring(triggerBody()?['receivedDateTime'], 11, 8 )

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 398 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 323 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 183 Most Valuable Professional

Last 30 days Overall leaderboard