Showing results for 
Search instead for 
Did you mean: 
Advocate I
Advocate I

Date works in preview but not in published app

Hello everyone,


I am having an issue with a published app, I have deleted and rebuilt the section responsible including deleting and adding the column back into SharePoint.


I've never had this issue before but basically in preview mode a date field within a form works fine and gets saved, within the published version however nothing, it just saves everything else in the form except for this one field. I haven't tried all of the fields though tbh.


Anything out there? I have found similar issues on this forum but they all seem far too old to be relevant anymore.


Thanks in advance,



Community Support
Community Support

Hi @Blytheee ,

Could you please share a bit more about your issue within your app?

Do you mean that the date field value could not be saved back to your SP List in your published app?


Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned.

Please consider remove the Edit form from your canvas app, then re-add a new Edit form, then bind this new added Edit form to your SP List data source, then enable desired fields data cards in this Edit form. Set the Item property of this new Edit form to following:

BrowseGallery1.Selected   // bind it to selected item in your Gallery

modify the reference of your previous Edit form in your app with this new Edit form. Then re-publish your app, check if the issue is solved.


If the issue still exists, as an alternative solution, I think the Patch function could achieve your needs. Please set the OnSelect property of the "Submit" button to following:

   EditForm1.Mode = FormMode.New, // EditForm1 represents the Edit form in your app, please replace it with actual form name in your app
         'Your SP List',
         Defaults('Your SP List'),
         'Your SP List',

Patch function


Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-xida-msft ,

Thanks for your reply. I am reluctant to go ahead and remove the form due to the fact that all of the visibility and locations of the cards are coded so it means going through and amending around 45 datacards again plus all of the custom drop downs, combo boxes and fields I have added, it does work with a new form that I added as a test so it is just this form but I would like not to have to spend another few hours going through all of the fields again. Plus all the other references to the edit form that will then break.


I have deleted and added the fields in SharePoint, and also deleted the datacard and added it back in.


Update: I have added Patch instead of SubmitForm and it works for everything except this date field.





HI @Blytheee ,

Currently, I could not reproduce your issue on my side. If you just want to save new record and edit existing records in your SP list, you do not need to make any changes to your Edit form, I think the Patch function I provided above could achieve your needs.


For the formula I provided above, it would check if the current Edit form is in New mode or Edit Mode. If the Edit form is New mode, execute the Patch function to add new record back to your SP List with your Form data, if the Edit form is Edit mode, execute the Patch function to update the existing record in your SP list with your Form data.

Note: It's no need to add a collection to do a ForAll formula.


You could consider submit an assisted support ticket to get further help through the following link:


Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-xida-msft,


No luck with anything, Patch will not work with the date still, thanks for the code, it's much simpler than any Patch code I have seen before and works well but just doesn't solve this issue.


I will open a ticket, it will be hours of recoding the form to build it again which I want to avoid.


It now doesn't work in Preview either.



Hi @v-xida-msft,

I found that the code below worked but only once, you have to go out and back into the screen for it to work again, this is due to the ETAG mismatch. I tried to overcome it with refresh's but this doesn't seem to work. The DatVar is set to the default on ScreenVisible so that if it isn't changed it will patch the current one.

Set(DateVar, DataCardValue157.SelectedDate);
Refresh('Core Cases');
Patch( 'Core Cases', DataTable5.Selected, { 'Placement Required By': DateVar } );
Refresh('Core Cases');

Helpful resources

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,144)