cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
fless1
Advocate I
Advocate I

Null value for Date Variable

setting  varDate=datepicker.selecteddate but want to set varDate to be blank if a tick box "No date required" is selected

 

but set(varDate,"") comes up with "imcompatible type" error

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Drrickryp
Super User
Super User

Hi @fless1,

check this out https://powerusers.microsoft.com/t5/General-Discussion/Update-blank-Null-value-to-fields-Date-User-C...

it may be the answer you are looking for. If it works, please mark this thread as solved.

View solution in original post

4 REPLIES 4
Drrickryp
Super User
Super User

Hi @fless1,

check this out https://powerusers.microsoft.com/t5/General-Discussion/Update-blank-Null-value-to-fields-Date-User-C...

it may be the answer you are looking for. If it works, please mark this thread as solved.

Thanks loads
cbrazenec
New Member

Instead of "", use Date(Blank(),Blank(),Blank()).  Sets it to null value, but in a date format.

takolota
Power Participant
Power Participant

None of these answers worked for me and I really did not want to recreate the date columns in separate text columns.

I had to use this formula on the submit button:

SubmitForm(Form1); If(Or(IsBlankOrError(DataCardValue8.SelectedDate), IsBlankOrError(DataCardValue9.SelectedDate)), RecordsRetentionSetNullDates.Run(RecordsRetentionList.Selected.ID, IsBlank(DataCardValue8.SelectedDate), IsBlank(DataCardValue9.SelectedDate)), "");

 

And set up a corresponding flow to input those null values in the date fields.

takolota_0-1646780447245.png

 

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,257)