You are viewing limited content. For full access, please sign in.

Question

Question

Passing date format in form not holding

asked on December 19, 2022

Working in LF cloud, I have a form with a date picker. Format of YYYY-MM-DD. User selects date of Dec. 19, 2022 and it displays 2022-12-19. All good so far.

But, when the form is submitted, the date variable format is "changed" 12/19/2022 (MM/DD/YYYY).

How can I keep the variable date format the same as what I selected on the form? I need it in that format to save to a table for sorting correctly later on in the process.

0 0

Replies

replied on December 19, 2022 Show version history

When you say it is being stored in the wrong format, where exactly do you mean?

When you have a date field, it isn't really being stored in any format, it is being stored as an actual date value, so the format depends more on wherever it is being rendered.

Basically, when you tell Forms to use YYYY-MM-DD, that is just telling it how to render the underlying value, but a date is always "stored" the same way so that is just a mask.

If you want the value to be literally stored in that exact format, then you would need to do so in something like a Single Line field.

0 0
replied on December 19, 2022

I am referring to the variable being passed in the process. When I view the process variables, the date is not in the same format as what the user selects.

The next step in the process is to save the variables to a table, and that is where my sorting issue comes into play. The date format is not YYYY-MM-DD, but rather MM/DD/YY.

It seems like I just need to format the token how I want then before saving to table?

0 0
replied on December 19, 2022

Right, but when you're viewing the Process Variables, that is being rendered/formatted by the UI page where you are viewing the value.

The underlying value is just a date, and the UI handles the formatting.

What table are you saving the data to? For example, are you talking about a table within Forms, or a database table?

This will make a big difference in how you should save the value, for example, if you're putting it into a DateTime column in SQL then the format is not going to stay anyway.

0 0
replied on December 19, 2022

It will be saved into a table within Forms, then referenced (and sorted) later on.

0 0
replied on December 19, 2022

Okay, the better question is, where will the sorting occur because that is where it will matter the most.

If you add it to the table as a date field, then all you need to do there is set the display format.

0 0
replied on December 19, 2022

I plan on sorting the date field in a later step when pulling the data to display in a table that will be on a form.

Basically, user submits request, and that request is saved to a table. Internally user task then selects a "scheduled date" for inspection for the new requests.

On that same form, there is a table that displays the same table of data (but only ones that are already scheduled) so the user does not over-schedule a specific day. This is where I have them sorted by date.

Hope that makes some sense as to what I'm trying to accomplish. Thanks for all your assistance.

0 0
replied on December 19, 2022

I'm still not clear on the intended sorting mechanism and whether or not there will be database tables and lookups involved.

Either way, when you're working with true "Date" data types, the display formatting isn't really important for sorting.

The only time the format would cause issues with sorting is when the values are being evaluated as plain text, and that depends on how you plan to sort.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.