
Announcements
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.
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*
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!