issue using an action to change the ending time in a form

Hello!

I have a form view with 2 fields, the start time, the time when the user starts filling the form, and the second field, the time the form is finished and saved in the DB.

For the ending hour, I created an action where I set the "end time" column to now(). In the DB (postgresql) the end time is saved correctly, but in the .pdf file which is sent using the automation I created, the time is the same as the start time, if I set the initial value of the end time field as now () and if I do not set anything as initial value, there is no end time at all on my .pdf .

I repeat, in the DB the time is correct.

Could anyone tell me what is the cause?

As a remark, after validation of the manager, the next automation used sent a .pdf file with the good ending hour.

Thank you for your help!

Regards!

Ruxandra

 

Solved Solved
1 22 474
2 ACCEPTED SOLUTIONS

No problem, let's take it step by step:

  1. First, please have a *new* physical column, let's call it "Counter", type Number. Set its Initial Value to 0
  2. In your "OraFinalizareControl" action, click on "Add", select your "Counter" column, and put the expression in the field on the right to: [Counter] + 1.
    Joseph_Seddik_0-1715508605806.png
  3. Set your "OraFinalizareControl" action, as the Form Served action of your form view. 
  4. Set your Bot's event to "Updates" not "Adds", and put the following expression as a Condition: 
    NOT([_ThisRow_Before].[Counter] = [_ThisRow_After].[Counter])

View solution in original post

DateTime raw values are just a number, for example the most common current time representation of when I'm writing this post is: 1715532251. In PostgreSQL the same datetime will be stored as a different value but it will also be just a number. The conversion between the two is handled by AppSheet according to your data source.

In your app, the format each user will be seeing depends on his own Locale/Regional Settings of his device. So English users will see 3 p.m, while other Europeans will see 15:00. 

In case you want to force a certain display format, yes you can use AppSheet's TEXT() function, but you should NOT do that in your dateTime column. Instead, you should create a new Text-type virtual column, the one that will be displayed to the users, leaving your dateTime column hidden and *unchanged*. 

So in summary:

  1. Do NOT change your Date or DateTime columns. Leave them as is. 
  2. For display purposes, have another virtual column with the formula:
      TEXT([dateTimeColumn], "HH:MM") or TEXT(TIMENOW(), "HH:MM")

View solution in original post

22 REPLIES 22
Top Labels in this Space