Is there a way to blacklist dates on the date...

references
(Frederik Munk Brønserud) #1

Is there a way to blacklist dates on the date-selector?

I would like to automatically disable the possibility of entering any day that is in a weekend, or is a national holiday (in Denmark).

I could potentially make a list of dates that are not accepted, and cross reference with that, but would that remove the date from the selector, or just make an error when the user tries to sync?

(Praveen Seshadri (AppSheet)) #2

Unfortunately, we do not control the date selector — it is a default input component from your device/browser. Best you can do is to put in a Valid_If constraint that checks if the input date is valid

(Frederik Munk Brønserud) #3

@praveen Thanks! How do I set up a Valid_If constraint to check against my blacklist?

(Suvrutt Gurjar) #4

Hi @Frederik, I tried this. i put the expression

NOT(

IN(Entry Date], Dates[Lookup Date])) in the Valid_If constraints attribute of the [Entry Date] column. The [Entry Date] is the data entry date column that user wishes to set.

Dates is the lookup table containing lookup dates that the app builder wishes to

prevent the user from entering. [Lookup Date] is the column of lookup dates or barred dates in the Dates table.

The user can see and enter the barred dates from the dates selector but the column constraint will disallow the form to be saved and will throw an error message. You can modify that error message per your needs…

Not sure if this helps you. But just thought of sharing.

(Suvrutt Gurjar) #5

Hi @praveen Sorry that I saw your post after I posted my post that I was typing in.

(Frederik Munk Brønserud) #6

@Suvrutt_Gurjar Worked perfectly for me, thank you!