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

Question

Question

Pass a date via Query String?

asked on November 6, 2019

Hey team, 

I'm having one of those days where I feel like I'm missing something super obvious or basic. Does anyone have any tips or examples of how to pass a date format via Query String with Laserfiche Forms?

eg. for the date: 16-11-2019 (DD-MM-YYYY)

https://forms.laserfiche.com/Forms/BigForm?DateFieldVar=16-10-2019
https://forms.laserfiche.com/Forms/BigForm?DateFieldVar=16%2F10%2F2019
https://forms.laserfiche.com/Forms/BigForm?DateFieldVar=2019-10-16

etc

Haven't been able to get this to work?

Has anyone else had any success?

 

0 0

Answer

SELECTED ANSWER
replied on November 17, 2019

Hey Jared,

Thanks for looking into it further and for your suggestions. I was able to troubleshoot the issue and find the cause. To improve our end user experience in most of our forms we typically specify "current_date" as the default for date pickers. By removing the default "current_date", the value passes via query string with no issue (and correctly).

However, the odd part is, the date field is the only field we've come across which does not prioritise the query string value over the default value.

For example, the "Existing Employee" radio button field is selected by default. Passing "New%20Employee" via query string overrides the default when the form loads.. however, the date (if specified as default either directly or as current_date) is ignored completely by the query string.

Considering we try to design our forms with convenience in mind for our end users, having to leave the date field blank for 80% of users in order to pass query string values for the other 20% of users does feel counter-intuitive to us.

I'll let you decide whether or not that is considered correct behaviour (there may be a reason for it!).

Thank you for looking into it no less!

1 0

Replies

replied on November 6, 2019
1 0
replied on November 10, 2019

Thanks, I had previously tried that and it doesn't seem to work. Both date formats. 

 

 

Which browser did you use where that worked?

0 0
replied on November 10, 2019

I used chrome and fire fox, but should be compatible with any browser. I was also using an on premise installation, but the parameters should be the same on the cloud. I used Date_1 as the variable name.

1 0
replied on November 11, 2019

What version of Laserfiche Forms are you using? I've got a feeling this has either been fixed in the latest version of Forms or it is a browser locale based bug which I'll need to report. Eg. Was tested in the US (MM-DD-YYYY) and worked, however, fails to work for non-US date formats (DD-MM-YYYY).

If you get a chance, could you try with a date like 13/06/2019 and then try with 06/13/2019 and see if it stays blank or provides some type of error?

Thanks Michael! 

0 0
replied on November 11, 2019

I tested it on 10.3.1.635.

1 0
replied on November 13, 2019

Interesting, I'm on 10.4.0.1256 so that means it is likely a bug that found its way into later versions or that may not have been tested in browsers with non-US locale set.

Paging @████████ / @████████ 


Can you guys confirm this is an issue and if so please raise a bug report? Thank you!

0 0
replied on November 14, 2019

Make sure your URL mapping matches the variable's casing as well. Does your variable use capitals like that? 

1 0
replied on November 14, 2019

Hey Jared, 100% accurate. I copy+paste directly from the variable field to guarantee it.

Bit of a strange one this.. here's some additional insights:

 

As you can see the New Employee is passing but the date isn't. The date by itself also doesn't work.

0 0
replied on November 14, 2019 Show version history

It looks like you're passing in November 16th, but the field is populating with Nov 15th, is that correct? You may need to open a support case for further investigation. This is working for me on all my local tests. 

It's possible that there is a mismatch in your browser location and you form server location and it's doing some time zone adjustment causing the date to be one day off. That's a guess though. I might be able to help more if you have a few more test cases. Is it always one day off? Or is the 15th a default value? Is there any other lookups or calculations acting on the field? 

Also try using the date format 11/16/2019, see if that works. 

0 0
SELECTED ANSWER
replied on November 17, 2019

Hey Jared,

Thanks for looking into it further and for your suggestions. I was able to troubleshoot the issue and find the cause. To improve our end user experience in most of our forms we typically specify "current_date" as the default for date pickers. By removing the default "current_date", the value passes via query string with no issue (and correctly).

However, the odd part is, the date field is the only field we've come across which does not prioritise the query string value over the default value.

For example, the "Existing Employee" radio button field is selected by default. Passing "New%20Employee" via query string overrides the default when the form loads.. however, the date (if specified as default either directly or as current_date) is ignored completely by the query string.

Considering we try to design our forms with convenience in mind for our end users, having to leave the date field blank for 80% of users in order to pass query string values for the other 20% of users does feel counter-intuitive to us.

I'll let you decide whether or not that is considered correct behaviour (there may be a reason for it!).

Thank you for looking into it no less!

1 0
replied on November 18, 2019

Glad you got to the bottom of the issue. This does sound like an inconsistency that should be addressed like a bug. 

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

Sign in to reply to this post.