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 / Duedate null value err...
Power Apps
Answered

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

(1) ShareShare
ReportReport
Posted on by 69

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')

Categories:
I have the same question (0)
  • Verified answer
    SueZeeBee_ganto Profile Picture
    69 on at

    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!

  • Suggested answer
    derb Profile Picture
    30 on at
    Another way to manage this is in the powerautomate field that handlesthe dynamic action, use an expresion with if(empty(dynamic action,value, dynamic action)  In this expression when you are writing it in the places "dynamic action", you toggle to the dynamic action tab to select the one you want. The "value" is the value you want defaulted if the field is null.  This worked great when processing Microsoft Forms with fields that are not required.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 494

#2
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#3
11manish Profile Picture

11manish 323

Last 30 days Overall leaderboard