web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / SubmitForm is not upda...
Power Apps
Answered

SubmitForm is not updating DateTime fields with Now()

(0) ShareShare
ReportReport
Posted on by 58

Hi

I have just noticed that a datetime column that is being submitted with the current time - Now() was not being updated with the timestamp.  The Updated attribute of the column is set to Now(). Subsequent submits use the time from the first submit.

This seems to have started after UTC 2020-06-01 06:00:00 after examining my data.


I believe this to be a bug and should only take 5 minutes to reproduce.


To reproduce the problem:-

1. create a sharepoint list and add one column that is a date with time column. 
2. create the default app over the sharepoint list. 
3. change the Update attribute of the datetime datacard in the default app's EditForm1 to Now()

Run the app and add a record - the first one works. Submitting more new records leaves the datetime as the first submitted.

I'm using SQL Server, and the same thing is happening there.

I hope you can help.

Robyn

 

 

Categories:
  • iamvivran Profile Picture
    20 on at

    I had faced this issue once for SQL server, then I believe I captured the datetime stamp at the SQL level, instead of capturing at Power Apps.

     

    Cheers!

    Vivek

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @RobynPr :

    Firstly,let me explain why you encount this problem.

    The point is Now and Today are volatile functions. Each time one of these functions is evaluated it returns a different value.

    When used in a data flow formula, a volatile function will only return a different value if the formula in which it appears is reevaluated. If nothing else changes in the formula then it will have the same value throughout the execution of your app.

    For example, a label control with Label1.Text = Now() will not change while your app is active. Only closing and reopening the app will result in a new value.

    Secondly,Instead of using Now() in the Default property set the Default to use the value of a variable.  Then in the timerEnd property of the timer set the value of  Now().  

    For example:

    1\Set the OnStart property to:

     

    Set(Var,Now()) /*Var is my custom variable*/

     

    2\Add a timer:

    Duration:

     

    5000 /*loop in 5 s*/

     

    AutoStart:

     

    true

     

    Repeat:

     

    true

     

    OnTimerEnd:

     

    Set(Var,Now()) /*Var is my custom variable*/

     

    Visible:

     

    false

     

    Best Regards,

    Bof

  • RobynPr Profile Picture
    58 on at

    Hi @v-bofeng-msft 

    Thanks for your reply.

     

    So shouldn't a reevaluation be done on SubmitForm or ResetForm?

     

    If PowerApps is meant to be low/no code and you have to include timers and the like to simply put a timestamp on a submitted record, this is contrary to the principles of the product. 

     

    Also, it seems that this behaviour has changed from June 1, 2020 as my App has been around for some time without this problem.

     

    I hope the two points I make are considered.

     

    Thanks

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @RobynPr :

    I think your opinion makes sense.

    If you want PowerApp to make improvements in this regard,I suggest you post your ideas to the following forum:

    https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

    At present, in order to make your app work properly, I suggest you to modify it according to the scheme I provided.

    Best Regards,

    Bof

  • RobynPr Profile Picture
    58 on at

    Hi

     

    And to the point about the behaviour changing on 1 June 2020?

     

    Thanks

  • Verified answer
    RobynPr Profile Picture
    58 on at

    Hi

     

    instead of using a timer, another simpler workaround to the bug is:-

     

    On the Submit button of your form screen, capture the timestamp:-

     

    UpdateContext({timestamp: Text(Now(),"yyyy-mm-dd hh:mm:ss.sss")});
    SubmitForm(EditForm1)

     

    On the Update attribute of your datetime datacard include:-

     

    DateTimeValue(timestamp)

     

     Adjust accordingly if saving as UTC, or if you don't want to update if doing an EditForm and not a NewForm.

    Cheers

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @RobynPr :

    Wonderful idea!

    I suggest you mark this idea as a solution so that more people can see it.

    Best Regards,

    Bof

  • peronis Profile Picture
    24 on at

    I have the timer implemented on the main screen of my app, and I want to use that updated time variable on other screens.  I see the timer variable doesn't update when i'm on another screen.  Is there a way for the timer to keep running while on another screen?

  • peronis Profile Picture
    24 on at

    I put a hidden timer on each screen. And it is working.  Consider this closed.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 339 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 289

#3
Mohsin Ali Profile Picture

Mohsin Ali 228

Last 30 days Overall leaderboard