Prevent Future Date Selection

jmpru2019
New Contributor

Prevent Future Date Selection

Hello! 

I'm building a model where users can input the dates when they complete certain training events, and then taking that information and creating visualizations/analytics off of it. In order to keep the data clean, is there a way to prevent the user from selecting a date in the future since I only want to deal with actuals in this instance? 

 

Thanks!

3 REPLIES 3
bhatjaved
Frequent Contributor

Re: Prevent Future Date Selection

@jmpru2019 

 

Yes there are many ways to place security for users ,depends where you wana restrict them and on which  dimensions ? 

Go through user security lessons in community you would be able to judge what type of security you can have in place . In brief you may want to restrict users here with the help of DCA . create drivers and restrict users accordingly 

rob_marshall
Moderator

Re: Prevent Future Date Selection

@jmpru2019 

 

Yes and no.  No, in the fact that if a user inputs an invalid date, we don't have a way to "clear" it out automatically or prompt them for a valid date.  With that said, there are a couple of ways you can get around this.

 

The easiest way is to use conditional formatting to highlight the line item in red (or color of your choosing) if the date falls outside of the threshold.  Also, create a boolean to be on (True) if the date is valid and now downstream calcs and reference the boolean as well as filters for views.

 

Another way is to have a list of days that can be used, but this can be cumbersome as well as a maintenance hassle.

 

Hope this helps,

 

Rob

ManjunathKN123
Occasional Contributor

Re: Prevent Future Date Selection

Hi,

 

You cannot avoid the same line item to prevent from entering future date. You can use above solution from rob to identify future dates by conditional formatting. 

 

But if you have additional information entered along with end date of training, you can stop that.

 

Add one more LI and format it as boolean and write formula to identify future dates and use it as DCA in other information(LI) where your trainers has to enter after end date. 

 

Additionally you can use a text formatted LI and use if else to display hard coded text like "please enter valid date".

 

Thanks,

Manjunath