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 Apps / Can't patch blank date...
Power Apps
Unanswered

Can't patch blank dates to Excel

(0) ShareShare
ReportReport
Posted on by

hello,

 

I am building an app for a client with a data source that accepts various dates in an excel table. datePicker.SelectedDate will update just fine when a date is selected. However, when adding a new record/new form powerapps gives an error when date fields are blank. 

 

patching_blank_error.png

 

Information about app:

Data is updated via form functions SubmitForm/NewForm.

Blank() textual data updates just fine, problem is only with date fields.

Formula Level Errors is enabled.

 

Things I've tried:

DataCard.Update: Blank() seems to work just fine. But will obviously not work for actual selected dates 

If statements do not work - DataCard.Update: If(IsBlank(DatePicker.SelectedDate), Blank(), DatePicker.SelectedDate) **Yields the error above.

Variations of said if statements don't work: DataCard.Update: If(IsBlank(DatePicker.SelectedDate), "", DatePicker.SelectedDate),

DataCard.Update: If(IsBlank(DatePicker.SelectedDate), Text(Blank()), DatePicker.SelectedDate),

DataCard.Update: If(IsBlank(DatePicker.SelectedDate), DateValue(Blank()), DatePicker.SelectedDate),

DataCard.Update: If(IsBlank(DatePicker.SelectedDate), DateValue(""), DatePicker.SelectedDate)

 

Now, I have found a workaround that successfully submits blank date. However, this workaround still results in an error that doesn't seem to interrupt the program. *Error below*

patching_empty_error.png

Workaround:

DataCard.Update: If(IsBlank(DatePicker.SelectedDate), DateValue("EMPTY"), DatePicker.SelectedDate)

 

I'm not really sure why this works but other variations of textual data like blank strings do not. 

As of now, I have this code in my program but am not really comfortable delivering the product like this. I don't like the idea of random peripheral errors in my code if they are avoidable.

 

Thanks!

Categories:
I have the same question (0)

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard