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 / Why, when I don't ente...
Power Apps
Answered

Why, when I don't enter a date, does it get recorded as 12/31/1969?

(1) ShareShare
ReportReport
Posted on by 831 Moderator
I have a form where the end date field is optional. However, if nothing is entered, it gets recorded as 12/31/1969. How do I avoid that?
 
Categories:
I have the same question (0)
  • abm abm Profile Picture
    32,985 Most Valuable Professional on at
    Hi
     
    Could you please give a  bit more information about the database? Dataverse or Sharepoint?
     
     
    Thanks
  • lbendlin Profile Picture
    8,703 Super User 2026 Season 1 on at
    That's the first Unix date, plus/minus your timezone.
  • futr_vision Profile Picture
    831 Moderator on at
    This is a Dataverse table
  • ronaldwalcott Profile Picture
    3,866 Moderator on at
    The field should store a blank value in your Dataverse table if nothing is entered but would display in the form based on the placeholder value
     
    If(IsBlank(Self.SelectedDate), Text(Date(2001,12,31), Self.Format, Self.Language))
     
    Is this value actually stored in the table or is the date column blank?
    If this value is stored then you setting it as a default value somewhere.
  • futr_vision Profile Picture
    831 Moderator on at
    @ronalwalcott
     
    This is what I have for the InputTextPlaceholder for that field 
    If(
        IsBlank(Self.SelectedDate),
        "No End Date",
        Text(Self.SelectedDate, Self.Format, Self.Language)
    )
     
    DeafultDate is Parent.Default
     
    The datacard Default is 
    If (
        varCopy,
        glbFormData.dk_enddate,
        ThisItem.'End Date'
    )
    When I do not enter a a date in the end date field then it gets written to the table as 12/31/1969
  • ronaldwalcott Profile Picture
    3,866 Moderator on at
    Are you using SubmitForm to save data or Patch?
    Is there any code in the form OnSuccess property?
     
    What are these values? 
     varCopy,
        glbFormData.dk_enddate
  • futr_vision Profile Picture
    831 Moderator on at
    The initial submission it is a SubmitForm. I do use a Patch on the OnSuccess of the form but that is for something else. Here is that code.
     
    Patch(
        'Placement IDs -DEVS',
        LookUp('Placement IDs -DEVS', 'Generated Placement ID' = LBL_TempPlacementID.Text) ,
        {'ID Used': "Yes"}
    );
    UpdateContext({varShowSpinner: false});
    UpdateContext({varCurrency: Blank()});
    UpdateContext({varCurrentTab: "CampaignDetails"});
    Navigate(Success)
     
    The last bit of code you are asking about if for a global variable. If the user decides to copy the record, I grab the record and put it in the global variable and navigate them back to the initial form and populate the form with the global variable data. The code you posted there is for the end date which ends up getting filled in as 12/31/1969 since that is what is being written to the Dataverse table.

  • ronaldwalcott Profile Picture
    3,866 Moderator on at
    Based on your response the problem is probably with the global variable. How are the global variables set and reset? Try removing the If and test to see if that is the cause of the problem.
  • futr_vision Profile Picture
    831 Moderator on at
    Hmm. Just the presence of a global variable, even if it is empty, would cause this issue?
  • ronaldwalcott Profile Picture
    3,866 Moderator on at
    It wouldn't but are you tracking the state when you are testing? If not, removing it would immediately indicate if it were the cause. 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,045

#2
Valantis Profile Picture

Valantis 675

#3
11manish Profile Picture

11manish 592

Last 30 days Overall leaderboard