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 / Patch Blank Date to Sh...
Power Apps
Unanswered

Patch Blank Date to SharePoint Date Field

(0) ShareShare
ReportReport
Posted on by 988

I am using a Gallery to Patch and Save to a SharePoint List, one of my fields is a date field (Closed Date).  The ForAll Patch doesn't save to SharePoint unless I have the Closed Date populated.  I want it to be blank until the item is updated.  How can I patch a blank date to SharePoint?

Categories:
I have the same question (1)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @kmw1130 

    In the advanced settings, activate Formula level error management.  Then you should be able to patch the date with Blank()

  • Community Power Platform Member Profile Picture
    on at

    @kmw1130 

    You need to turn Formula-level error management to ON, in Settings then you can simply Patch Blank() to that field.

     

    See here

  • kmw1130 Profile Picture
    988 on at

    @Anonymous It is turned on.  

  • Community Power Platform Member Profile Picture
    on at

    @kmw1130 

    Can you share your Patch formula. Also, is the Closed date set as 'Required' in SharePoint?

  • kmw1130 Profile Picture
    988 on at

    The Closed date is not required in SP.  Here is my Patch formula (I added the If(!IsBlank) on the DateClosed, but didn't make a difference).

     

    ForAll(TrackingCollection,
    Patch('Program Tracking',
    Defaults('Program Tracking'),
    {
    Title: LineType,
    'AssignedTo-Email': LineAssignedTo,
    Description: LineDescription,
    'Date Identified': DateValue(LineDateIdentified),
    'Date Closed': If(!IsBlank(DateValue(LineDateClosed)), DateValue(LineDateClosed)),
    'Tracking Resolution': LineResolution,
    Likelihood: LineLikelihood,
    Impact: LineImpact,
    'Contract Name': LineProgramName,
    BU: LineBU,
    ProgramID: FormIssues.LastSubmit.ID}));
    Navigate(TrackingOverviewScreen,ScreenTransition.Fade)

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @kmw1130 

    'Date Closed': Blank(),

    If you are adding a new item as indicated by Defaults('Program Tracking') it will be blank anyway so why the If() function. 

  • Community Power Platform Member Profile Picture
    on at

    @kmw1130 

    You need to explicitly force Blank(), ie

     

    'Date Closed': If( !IsBlank(DateValue(LineDateClosed)), 
     DateValue(LineDateClosed),
     // else
     Blank()
     ),
  • kmw1130 Profile Picture
    988 on at

    @Anonymous I tried that and it still does not save the collection items to my SP list.  If I put in a default date when I create the collection, then Save to SP it works.  If I do just Blank() as @Drrickryp suggested, it saves the collection data to SP, but when I got back to edit, the Patch is still set to Blank(), so I would think your If(!IsBlank) solution would work, but it didn't for me.

  • Community Power Platform Member Profile Picture
    on at

    @kmw1130 

    If Patching Blank() works on it's own then this suggests that there is something amiss with your date data type.

     

    Re-reading your code, you appear to be using a Text field and converting that to a Date (ie DateValue(LineDateClosed) ), then whilst using Blank() I think you are mixing up data types ... not sure.

     

    You could try using DateValue( Blank() ) or better still, use a DatePicker to select your dates instead of a text input.

  • kmw1130 Profile Picture
    988 on at

    @Anonymous My SP List field is a date field.  I'm creating a collection for a "Repeating Table" Gallery, each row in the Gallery has 2 date fields, one, Date Closed, will be able to update at a later time, so it needs to be blank.  It is Saved to the Collection as a blank entry and then when submitted to my SharePoint List, it doesn't submit the collection values to SP when the date field is blank. 

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