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
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!
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.
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.
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)
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.
Yes, i want a new form. I did what you suggested but didn´t change the behavior..:(
Try adding NewForm(Form3) after the resetform function. I assume you want a New form not an Edit form?
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.
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.
MS.Ragavendar
14
LC-26081402-0
10
stampcoin
6