Select to view content in your preferred language

Add a date constraint into Connect123 to only allow submissions 7 working days from now

207
1
09-05-2024 04:23 AM
AndrewReynoldsDevon
Regular Contributor

I'm working on a form in connect 123 which is published to arc enterprise 10.8.1 where the customer wants the form to not allow submissions before 7 working days from now. So for example 6 working days from now would generate an error but 7 working days from now would be ok.

It needs to be clever enough to recognise English bank holidays & weekends. 

The constraint message would say something like 'sorry you're trying to submit the form too early'

I've used this code '.> date(decimal-date-time(now()) + 10)' in the constraint column which is working for me but it recognise the difference between weekends, bank holidays & working days so this is what I'd like to aim towards if possible

Tags (2)
0 Kudos
1 Reply
DuncanC
Frequent Contributor

Are you allowed javascript?  Or is the form public facing (javascript in Survey123 is disabled)?

Without javascript I don't think it's possible.  With javascript it's doable, but my solution is still uglier than I'd like.  I don't know of a good way to load the list of bank holidays and would likely hard code it into the script and throw up a little in my mouth while doing so.  But how do I pass it an array?  Or have it access a CSV file?  I don't know if you can.  Once you have a list of dates in javascript it should be pretty trivial to calculate the date.

0 Kudos