Solved

Panel to only show when the date selected for 'date required' is less than 5 days from current date

  • 29 June 2022
  • 9 replies
  • 9 views

I would like a panel to become visible with a multi-line text box to justify why the date required selected is less than 5 days from the current date. I would also like it to be impossible for the user to select a date in the past. 

 

I have attached what I have tried, which unfortunately did not work for me. 

24173i438BAF2701A67C95.jpg

 

24174iF7AFB262759B0455.jpg

 

 

icon

Best answer by Garrett 29 June 2022, 16:18

View original

9 replies

Userlevel 5
Badge +13

Hi @Cerys 


 


To prevent users from selecting a past date


Refer to thomas_xu reply. You need to scroll the image.
Link:  Hi, in Nintex Form, how can i stop user to select ... - Nintex Community



 

Userlevel 5
Badge +13

Hi @Cerys 


 


The Date Control


Name: "DateEvent"


DateOnly: Yes


 


The Panel (with the Multiline Text Field)


ShowComments Rule



//Display comments when selected date is 5 or less days from current Date
dateDiffDays(Current_Date, DateEvent) <= 5

 


HideComments Rule



//Hide comments panel if EMPTY date
//Hide comments panel if Date Chosen is greater than 5
DateEvent == "" || dateDiffDays(Current_Date, DateEvent) > 5

 


hope that helps

Hi @Garrett 


 


Thank you for your help with this, I am still having some issues with the panel, once a date is selected, even if it is over 5 days from the current date, the panel displays and will not hide. 


 


The condition changes the Date Required to {ItemProperty:Property} when I close and reopen the rule so I'm not sure if this is why it isn't working? 


 



 


Date Required is the equivalent of DateEvent in my form 


 

Userlevel 5
Badge +13

Hi @Cerys 


 


Did you remember to Hide?



 


I tested it out and it is working.


Today is the 30th June. 


It hides the comments from 30th June until 5th July.


it shows the comments from 6th July onwards.


 


Just recheck the control names and the rules again. If its still not working, send the exported form (remove all sensitive items). I will have a look at it. 

Hi @Garrett


 


I may not have described the requirement well but I actually intended for the opposite, so the comment  section only appears within the 5 days and is hidden for any date onwards from 6th July, however I just deleted the panel and date control and restarted following your steps and it is still not hiding the panel when any date is selected, the panel is only initially hidden. 


 


I can send you the form but I am unsure how to do this? 


 


Thanks for the help so far 🙂 

Userlevel 5
Badge +13

@Cerys 


Click the Export button on the Designer toolbar



A file (.nfp) will be saved to your Download folder.


Send me that file.


 


 


 


 

Hi Garrett, I can only export as an XML file and it does not work when I try to open it. I also created a new form and followed your steps exactly but still can't get it working.
Hi Garrett, I have managed to get it working. For some reason CurrentDate did not work for me but I created a column in the list that stores today's date which I replaced CurrentDate with and it is working for me now. Thank you! 🙂
Userlevel 5
Badge +13

Hey @Cerys , that's great!!


 


CurrentDate isn't working for you? Strange


Pls don't type it, Instead select it using the Formula Builder



Insert Reference -> Common -> click Current Date.  



 


Hope that helps

Reply