I have a date/time data card that I am using to capture the date and time stamp of when a form is approved/submitted. Right now, when an item in the SharePoint list is approved/submitted, the field is showing tomorrow's date and a wrong time (instead of today's date and time). Here is how I have the field setup currently...
Default on the date/time datacard
Coalesce(
varMyDateTime,
ThisItem.'My Date Time Column"
)
Update on the date/time datacard
If(
MyForm.Mode = FormMode.New,
Now(),
ThisItem.'My Date Time Column'
)
I then have a dropdown that users use to select a decision. Once they pick a decision, the date and time should be set.
OnSelect of my dropdown
myColumn_dateValue.SelectedDate = Now();
myColumn_HourValue.Selected.Value = Text(Hour(Now()));
myColumn_MinuteValue.Selected.Value = Text(Minute(Now()));
UpdateContext({varMyDateTime: Now()});
Then in my Patch statement, I am doing this...
Patch(
'My SharePoint List',
Lookup(
'My SharePoint List', ID = ThisItem.ID
),
{
'My Date Time Column': varMyDateTime
}
)
This does displays the correct date and time when the user is first making the decision on the form (when they pick a choice from the dropdown), but when they click the submit button, a date for tomorrow and wrong time is saved in the SharePoint list. So after a user submits an item and goes back to review, they are always seeing the wrong date in the SharePoint list. What am I doing wrong, that is causing it to save tomorrow date?
Thanks for your help.