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 / Clearing a date in Sha...
Power Apps
Unanswered

Clearing a date in SharePoint list

(1) ShareShare
ReportReport
Posted on by 91
My PowerApp has started behaving strangely when I’m trying to clear a date field in a SharePoint list. The code is basically:
UpdateContext({MyValue: Text(Now(), “yyyymmddhhmmss”});
ClearCollect(tmp, MyValue);
Patch(MyList, First(Filter(MyList, MyID=varID)), {Col1: MyValue, Col2: Blank()});
Collect(tmp, MyValue)
Col2 is a date column in SharePoint list.
MyValue is cleared during the patch statement.
IfError doesn’t throwback an error
Require that this column contains information is set to No.
 
I need to clear this date. Can’t use a dummy date like 1/1/1900
 
Any suggestions why this has just started happening and how to avoid issues?
I have the same question (0)
  • stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
    @Samand Hi,
    Have you tried to use 
    DateValue(Blank()) for you Col2?
     
  • Samand Profile Picture
    91 on at
     
    Hi,
     
    Have now. Unfortunately this has the same results.
  • stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
    @Samand Hi,
    I think this is the patch's side effect, if any type empty, it will take it as 1/1/1900.
    What if you ignore that column ? Do you have value on Col2 from SPL ?
    What if you use JSON to formatting the column in the list setting? 
     
  • Samand Profile Picture
    91 on at
     
    I can’t ignore the column. The whole point is to delete a value that’s in there.
     
    What do you mean by “What if you use JSON to formatting the column in the list setting?
  • stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
    @Samand Hi,
    I mean:
    You can check the sharepoint list settings ( on the top right corner), for this column if it only contain date: ( consider the options)
    1.  Change to single text.
    2.  Use JSON format 
  • Samand Profile Picture
    91 on at
     
    Long term I can change this to text and I don’t need JSON to format the view of the column if it’s text. But that creates short term complications for front end users and potentially other complications that I would need to rule out before I can go ahead and do this. It’s not a solution I can implement quickly. It would just be a “band aid” and doesn’t solve my problem. I want the column in SharePoint as a date column. It’s not just for show.
  • stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
    @Samand Hi,
    please try update if that help ( I guess it might be the same).
     
    and also try implicitly give the value 1900-01-01, see what happen.
     
    otherwise last option from me is invoke power automate ( not sure if that will work ).
  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at
    Hi @Samand,
    I will add something here as what you posted should work providing this is not switched on
    I clear dates regularly by patching Blank() to them - just ran this on a test list and cleared the existing date as expected.
    Patch(
       TestFields,
       {
          ID: 1,
          DateTest: Blank()
       }
    )
    You might try
    Patch(
       MyList, 
       LookUp(
          MyList, 
          MyID = varID
       ), 
       {
          Col1: MyValue, 
          Col2: DateValue("")
       }
    );
     
  • Verified answer
    Samand Profile Picture
    91 on at
     
    Already have that disabled.
     
    Honestly not sure what is causing this issue, but something in my App is either causing variables to be processed after patches or an error that clears the variable.
     
    I’ve resolved my issue by replacing the variable with a collection and then patching the value from the collection and simplifying some nested if statements.

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