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 Apps / dueDateTime calculatio...
Power Apps
Answered

dueDateTime calculation based on StartDatePicker.SelectedDate + Complete by (days)

(0) ShareShare
ReportReport
Posted on by 173

Dear All,

 

I bulid a similar app as QuickTask by Microsoft. 

This is a part of my code what I use in OnSelect behind Save button. It is working well.

 

 

 

Set(
 TaskAddedToUser,
 Planner.CreateTask(
 SelectedPlan.id,
 TaskSelector.Selected.Title,
 {
 bucketId: SelectedBucket.id,
 startDateTime: StartDatePicker.SelectedDate,
 assignments: AssignToUser.Id
 }
 )
)

 

 

 

But I would like to add new parameter what is dueDateTime. I need to calculate this parameter based on the startDateTime and Complete by (days) it is an Excel from an OneDrive source, its contains the task's name and some features (for example detail and time requirement in days (=Complate by (days)). I already use this OnDrive source in this code because the TaskSelector Combobox data's from this. 

 

Do you have any idea how can I code it? 

Categories:
  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at
  • akosbanar Profile Picture
    173 on at

    Thank you for the tip but it is not working.

    akosbanar_0-1619175021591.png

     

     

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    If you hover over the darkest part of the red line in your formula what error does it show?

  • akosbanar Profile Picture
    173 on at

    akosbanar_1-1619176516057.png

     

     

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    Sorry for so many questions.   Can you expand the formula box so the next row can be seen?   Also if you hover over different parts of the red line more towards the right, does the error message change and become more specific?

  • akosbanar Profile Picture
    173 on at

    Sorry, I edited my previous message because there was a comma error. 

     

    This is the full code:

     

    Set(
     TaskAddedToUser,
     Planner.CreateTask(
     SelectedPlan.id,
     TaskSelector.Selected.Title,
     {
     bucketId: SelectedBucket.id,
     startDateTime: StartDatePicker.SelectedDate,
     dueDateTime: DateAdd(StartDatePicker.SelectedDate, TaskSelector.Selected.'Complate by (days number)'), 
     assignments: AssignToUser.Id
     }
     )
    );
    Set(
     ShowSuccess,
     true
    )

     

     And the error message:

    akosbanar_0-1619177336075.png

     

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    It looks like your 'days number' field is text.   If that is the case you will need to wrap it in a value something like this:

     

    Value(days number.text)

  • akosbanar Profile Picture
    173 on at

    No, it is not true because I was test it with a dropdown, a textinput and a label.

     

    Dropdown2.Selected.'Complete by (days)' + TextInput1

     

    akosbanar_0-1619421680876.pngakosbanar_1-1619421711595.png

    I'm sure it is number type data.

     

  • Verified answer
    akosbanar Profile Picture
    173 on at

    Thank you very much for your last tip @JR-BejeweledOne!

    Set(
     TaskAddedToUser,
     Planner.CreateTask(
     SelectedPlan.id,
     TaskSelector.Selected.Title,
     {
     bucketId: SelectedBucket.id,
     startDateTime: StartDatePicker.SelectedDate,
     dueDateTime: DateAdd(StartDatePicker.SelectedDate, Value(LookUp(Tasks,Title = TaskSelector.Selected.Title, 'Complete by (days)'))),
     assignments: AssignToUser.Id
     }
     )
    )

     It is working well. 

     

    All the best,

    Ákos

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 Apps

#1
11manish Profile Picture

11manish 221 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 120

Last 30 days Overall leaderboard