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 / Now() function not ref...
Power Apps
Unanswered

Now() function not refreshing automatically

(0) ShareShare
ReportReport
Posted on by 16

Hello community!

 

I have an app that has a DataCardValue that is configured to show the date/time information of Now (instantly).

 

The function Default is configured to Text( Now(); "[$-pt-BR]mm/dd/yyyy hh:mm:ss" ). The problem is that when i submit the form where this field is it doesn´t refresh after the submit of the form. So, when i have the form clear again to insert another record, this field stays with the same information as before. It used to work before, but now is not working anymore and I didn´t change anything. Could somebody please help me???

 

Thank u in advance

 
Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at

    @rafaellobo 

    Have you tried ResetForm(myFormName) before starting a New form?

     

    The other thing here may be to do with the process following your SubmitForm(). I generally take users back to the previous screen rather than staying on the same Edit Form screen as this will reset the app state to where I want it. If you are remaining on the same screen then you will need to re-run the same code that got you there initially.

  • rafaellobo Profile Picture
    16 on at

    Hi Eelman, yes. I register the information I want in the form and have a button to save the data inserted in a SQL database. This information of the date/time is saved also. In this same button (Save), i have a command that is ResetForm(Form3). This is the name of the form (Form3). The form is reseted in the other 3 fields, but the field with Now() function doesnt refresh. In this app i cannot go into another screen and comes back again, because i need to register information in a high speed process.

  • Community Power Platform Member Profile Picture
    on at

    @rafaellobo 

    Try adding NewForm(Form3) after the resetform function. I assume you want a New form not an Edit form?

  • rafaellobo Profile Picture
    16 on at

    Yes, i want a new form. I did what you suggested but didn´t change the behavior..:(

  • Community Power Platform Member Profile Picture
    on at

    @rafaellobo 

    So, I was able to re-produce your issue and I have a solution, of sorts. Use a variable to set the Date and Time and reference this in your DataCard. Eg

     

    Set(vDateTime, Text(Now(),"[$-en-US]dd/mm/yyyy hh:mm:ss")); SubmitForm(Form3)

    DataCard50.Text = vDateTime

     

    This will set the Date & Time just before Submit so it'll be close. If you don't need to display Date/Time to the user you can just hide the DataCard but if the user needs to see this Date & Time then you could also re-run the above Set() just before NewForm(Form3), eg

     

    Set(vDateTime, Text(Now(),"[$-en-US]dd/mm/yyyy hh:mm:ss")); NewForm(Form3)

     

    These timings may not be ideal but it works.

  • rafaellobo Profile Picture
    16 on at

    Thank you Eelman. Can you just help me to understand what kind of control i have to create to establish this variable?

     

    And, i´m trying to use this script, but it´s showing me a syntax error:

     

    Set(vDateTime, Text(Now(),"[$-en-US]dd/mm/yyyy hh:mm:ss")); SubmitForm(Form3)

     

     

  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    @rafaellobo 

    My apologies, I should have said to use your syntax for the text inside the Text() formula, ie

     

    Text( Now(), ... your format here ... )

     

    You don't need a control for variables, they basically 'float' around inside the app ready to be referenced or used. Here you use it for your DataCard but you can use it inside a label if you want, or whatever.

  • rafaellobo Profile Picture
    16 on at

    Thanks Eelman. Sorry for the quantity of questions kkkkk.

     

    My question is how I create this variable? To bring this information: Set(vDateTime, Text(Now(),"[$-en-US]dd/mm/yyyy hh:mm:ss")); SubmitForm(Form3)

     

    I don´t know where I create it in PowerApps to referente it in the DataCard text information.

  • rafaellobo Profile Picture
    16 on at

    Eelman, it worked successfully!!

     

    I was able to create a button with the variable and hided it. And in the field i needed to refresh, i pointed to this variable.

     

    Worked perfectly!

     

    Thanks a lot for your patience and attention!

     

    Marked as solution!

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard