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

Adding Days to a date pulled from a forms response

My current pickle - I am a teacher and have quite a few graders working for me to grade in quite a few classes. We use planner in teams so they can let each other know who is grading/responsible for which assignment. The classes we teach occur regularly and always have due dates based on the start date of the course. 

 

I have set up a Form with a date question "Start Date of Course" and a choice question to pick the class that is running.

 

My goal is to use the form (for now, this will be in salesforce eventually) anytime a new class starts to create items in Planner; specifically it is set to create a bucket (the class) and all associated assignments (tasks) w/ due dates as the graders are to grade on a FIFO system based on due date.

 

I keep hitting an error when getting to the "Create a Task" step because of the due date.

 

In the due date field, I can not figure out how to use the "Start date of course" (a response from the form in date format

Machine_0-1611611723422.png) with the "addDays" function.

When setting up the FORM, I did make sure to use the "Date" feature on the question. If I use the "Start Date of Course" content directly in the "Due Date Time" under "Create a Task" it works fine; but I can not figure out how to change that date. 

Machine_1-1611611907375.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Gopala_Krishna
Super User
Super User

@Machine 

On the addDays function you can also specify the format of the resulting value, addDays function accepts three parameters 1 - The timestamp to which the days have to be added,2- number of days to add,3- format in which the resulting value has to be in. 

 

Let us consider that I am using the addDays function and I want my result to be in format MM-dd-yyyy then I will specify this as a third parameter of the function.

 

Also the planner expects the date values to be in full time format which is yyyy-MM-ddThh:mm:ss.ssZ

 

To ease the process you can use the default action from power automate

Gopala_Krishna_0-1611682321460.png

 

This will directly give you the desired result, for more information related to the planner action please check - Planner - Connectors | Microsoft Docs

 

For information related to timezone format and how to setup - ISO 8601 - Wikipedia

 

If the information shared helps you, please consider giving a thumbs up 👍 and mark solution as resolved.

View solution in original post

2 REPLIES 2
Gopala_Krishna
Super User
Super User

@Machine 

On the addDays function you can also specify the format of the resulting value, addDays function accepts three parameters 1 - The timestamp to which the days have to be added,2- number of days to add,3- format in which the resulting value has to be in. 

 

Let us consider that I am using the addDays function and I want my result to be in format MM-dd-yyyy then I will specify this as a third parameter of the function.

 

Also the planner expects the date values to be in full time format which is yyyy-MM-ddThh:mm:ss.ssZ

 

To ease the process you can use the default action from power automate

Gopala_Krishna_0-1611682321460.png

 

This will directly give you the desired result, for more information related to the planner action please check - Planner - Connectors | Microsoft Docs

 

For information related to timezone format and how to setup - ISO 8601 - Wikipedia

 

If the information shared helps you, please consider giving a thumbs up 👍 and mark solution as resolved.

View solution in original post

Machine
Regular Visitor

@Gopala_Krishna I ended up using the default action as you suggested. With the number of assignments and due dates, I was hoping keep it within the create a task action as a way to keep the automation a little cleaner. Just have to keep good/better track of which date I'm calling with the default action I suppose.

Thank you for the reply! 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,873)