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

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,865 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,474 Super User 2025 Season 2 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,847 Super User 2025 Season 2 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,847 Super User 2025 Season 2 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,847 Super User 2025 Season 2 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,847 Super User 2025 Season 2 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

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard