cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SueZeeBee_ganto
Helper I
Helper I

Duedate null value error when using Powerautomate to add a Planner task with task descripton

I've built an app to show and also be able to add tasks to a certain Planner with PlannerId.

Because I couldn't add a new Planner task with a task description in one onsave button transaction in Powerapps, I've tried using Powerautomate.

The scripts runs fine when I put a date in the Duedate field in my powerapp.

However, the value for DueDate can also be null (I put the Default value for the DuedateCalendercontrol to Blank()).

This generates an error in Power Automate. Can anyone help me with the correct syntax/formula/solution for the function in PowerAutomate? 

I've tried this formula in Powerautomate in the DueDate field based on a combination of posts I've read about this subject, but it gives an error when I test it.  

If(empty(triggerBody()?['Createatask_DueDateTime'],null,formatDateTime(triggerBody()?['Createatask_DueDateTime'],'dd-mm-yyyy')

1 ACCEPTED SOLUTION

Accepted Solutions
SueZeeBee_ganto
Helper I
Helper I

After some more investigation and exploration, I found out that the error occured in PowerApps and the Powerautomate process did not even run in case of an empty duedate. The error in Powerapps said the method run had an invalid value for parameter DueDate. So what I've done now:

  • made a Powerautomate flow with a create task with the field DueDate empty
  • made a Powerautomate flow with a create task with the field DueDate (ask Powerapps-variable)
  • added an Updatecontext function on the on change property from my calendar control for Due date to change to true 
  • the onselect property of my save button runs the first Powerautomate script if the duedatevariable is false, the second Powerautomate is it is set to true

And it works!

View solution in original post

1 REPLY 1
SueZeeBee_ganto
Helper I
Helper I

After some more investigation and exploration, I found out that the error occured in PowerApps and the Powerautomate process did not even run in case of an empty duedate. The error in Powerapps said the method run had an invalid value for parameter DueDate. So what I've done now:

  • made a Powerautomate flow with a create task with the field DueDate empty
  • made a Powerautomate flow with a create task with the field DueDate (ask Powerapps-variable)
  • added an Updatecontext function on the on change property from my calendar control for Due date to change to true 
  • the onselect property of my save button runs the first Powerautomate script if the duedatevariable is false, the second Powerautomate is it is set to true

And it works!

View solution in original post

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!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,385)