Skip to main content

Notifications

Community site session details

Community site session details

Session Id : Rle0FxYFsNJkvN2Sy+hr9Y
Power Apps - Building Power Apps
Answered

Now() function not refreshing automatically

Like (0) ShareShare
ReportReport
Posted on 6 Jun 2020 01:53:48 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

 
  • rafaellobo Profile Picture
    16 on 06 Jun 2020 at 13:05:53
    Re: Now() function not refreshing automatically

    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!

  • rafaellobo Profile Picture
    16 on 06 Jun 2020 at 11:56:30
    Re: Now() function not refreshing automatically

    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.

  • Verified answer
    Community Power Platform Member Profile Picture
    on 06 Jun 2020 at 04:44:29
    Re: Now() function not refreshing automatically

    @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 06 Jun 2020 at 04:25:05
    Re: Now() function not refreshing automatically

    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)

     

     

  • Community Power Platform Member Profile Picture
    on 06 Jun 2020 at 03:59:48
    Re: Now() function not refreshing automatically

    @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 06 Jun 2020 at 03:03:25
    Re: Now() function not refreshing automatically

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

  • Community Power Platform Member Profile Picture
    on 06 Jun 2020 at 02:46:20
    Re: Now() function not refreshing automatically

    @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 06 Jun 2020 at 02:33:50
    Re: Now() function not refreshing automatically

    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 06 Jun 2020 at 02:29:26
    Re: Now() function not refreshing automatically

    @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.

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
MS.Ragavendar Profile Picture

MS.Ragavendar 14

#2
LC-26081402-0 Profile Picture

LC-26081402-0 10

#3
stampcoin Profile Picture

stampcoin 6

Overall leaderboard