Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

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

(1) ShareShare
ReportReport
Posted on by 930

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. 

 

  • VictorIvanidze Profile Picture
    VictorIvanidze 11,853 on at
    Re: Send auto-replies to senders when a new email arrives after office hours not working

    Use this:

    substring(triggerBody()?['receivedDateTime'], 11, 8 )
  • Ellis Karim Profile Picture
    Ellis Karim 10,535 on at
    Re: Send auto-replies to senders when a new email arrives after office hours not working

    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.

  • HamidBee Profile Picture
    HamidBee 930 on at
    Re: Send auto-replies to senders when a new email arrives after office hours not working

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

     

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

     

     

     

     

  • srduval Profile Picture
    srduval 1,663 on at
    Re: Send auto-replies to senders when a new email arrives after office hours not working

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

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,475

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,767

Leaderboard