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 / Expression for Due Dat...
Power Automate
Unanswered

Expression for Due Date Time field on Planner task

(0) ShareShare
ReportReport
Posted on by

Hi everyone! 

 

I'm trying to create a flow that creates a Planner task when a Form response is submitted. Where I'm specifically having trouble is on the task Due Date Time field. 

 

I need the due date to be three days before my Requested Send Date. The Requested Send Date is one of the data fields from my Form, and I've pulled it into the below expressions as: 

(body('Get_response_details')?['rd11379f17ee94ff5afe9aee5b6567aa5']

 

Here's the full expression I have in the Due Date Time field currently: 

 

addDays(body('Get_response_details')?['rd11379f17ee94ff5afe9aee5b6567aa5'],-3,'mm/dd/yyyy')

 

I've also tried: 

@equals(formatDateTime(body('Get_response_details')?rd11379f17ee94ff5afe9aee5b6567aa5'],'MM/dd/yyyy'),formatDateTime(addDays(body('Get_response_details')?rd11379f17ee94ff5afe9aee5b6567aa5'],-3),'MM/dd/yyyy'))

 

Both versions return status code 400 with this error message when I try to run the Flow: 

{
 "error": {
 "code": "",
 "message": "The request is invalid:\r\nCannot convert the literal '00/23/2018' to the expected type 'Edm.DateTimeOffset'.",
 "innerError": {
 "request-id": "814b5dd1-205d-4cef-8ccc-ef10a49e3887",
 "date": "2018-01-19T19:13:11"
 }
 }
}

I've looked at a bunch of the discussions here and tried to figure this out, but I am throroughly stuck. Any pointers would be greatly appreciated!! 

Categories:
I have the same question (0)
  • BigShotRob Profile Picture
    46 on at
  • Verified answer
    v-xida-msft Profile Picture
    on at

    Hi @Anonymous,

     

    Could you please share a screenshot of your flow's configuration?

     

    The error message told that the value you provided within Due Date Time field of "Create a task" action is not valid, the "Create a task" action could not convert the value that you provided into a expected type.

     

    I have made a test on my side and please take a try with the following workaround:

    • Add a "When a new response is submitted" trigger.
    • Add a "Apply to each", input parameter set to output of the trigger.
    • Within "Apply to each", add a "Get response details" action, Response Id field set to Response Id dynamic content of the trigger. 

             Add a "Create a task" action, Start Date Time field set to following formula:

    utcNow()

           Due Date Time field set to following formula:

    addDays(body('Get_response_details')?['rc787195479ff44329dd91fb703b380a8'],-3,'yyyy-MM-ddT00:00:00Z')

    Note: I have pulled the Requested Send Date data field from my Form into following expression:

    body('Get_response_details')?['rc787195479ff44329dd91fb703b380a8']

    Image reference:2.JPG

    The flow works successfully as below:3.JPG

     

    Best regards,

    Kris

  • Community Power Platform Member Profile Picture
    on at

    Thanks so much for the help, Kris! 

     

    Here is a screencap of my flow; your suggestion below worked. For whatever reason, changing the Start Date Time to the utcnow() function, rather than the 'Submission Date' value from the Form made the Flow run successfully. Thank you again! 

     

     

  • amravdrness Profile Picture
    2 on at

    Hi Some of the aboe doesnt work 

     

     

    1. when trying to pick dynamic content of "Respond ID" - the only dynamic option displayd in the menu is "List Response Notifications Response ID"

     

    2. the addDays refuses to work in any variation... I've tried them all.

    an expression error or data time error always prevent it from accepting it 

     

    3. you havnt mentioned which dynamic option you choose from the "aplly to each" selectec output... 

     

    there are 4 options in the menu, all expect "body" are called "List response XXXXXXX"

     

     

     


    Chance you can help sorting this one out? 

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…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard