How can I check whether a specific date exists in a date field of a database table?
Context: I have a date picker element on a form and I don’t want the user to be able to submit the form if the specified date is already in the database table.
So I intend to implement this validation as an “Only when” condition in a workflow. See screenshot below.
But:
whenever I try and test whether the value of the DatePicker element is in the database table, I only get an “is not in” option. There’s no “is in” option available to select in the expression.
whenever I try and test whether the dates in the database table contain the date in the DatePicker element, then the DatePicker is shown disabled and I cannot select it in the expression.
P.S. If it’s not possible to do such a check in the database, what alternative approach could I take to validate the Date Picker input?
I just played around with the Date/TimePicker and Database and tested for the matched case (A button “Retrieve” is hidden, means the date exists in a date field of database table). I tested the case of “contain”, not sure if it is related to the “formatted as” feature when using “contain”. I think you can have a try on it.
Dates are numbers for computers. This means that each millisecond that passes is a different value. Many “dates” within one date ….
It may be easier to build text conditionals.
After each date (two are being compared right?) … use :formatted as 6/13/22 This will enable you to build an expression like input date formatted as 6/13/22 is dB date formatted as 6/13/22. You will be comparing one text to be the same in both input and dB.