Skip to main content
Nintex Community Menu Bar
Solved

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

  • June 29, 2022
  • 9 replies
  • 17 views
  • Translate

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

 

 

 

Best answer by Garrett

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

View original
Did this topic help you find an answer to your question?

9 replies

Garrett
Forum|alt.badge.img+16
  • Scout
  • 904 replies
  • June 29, 2022

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

 

Translate

Garrett
Forum|alt.badge.img+16
  • Scout
  • 904 replies
  • Answer
  • June 29, 2022

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

Translate

  • Author
  • 9 replies
  • June 30, 2022

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 

 

Translate

Garrett
Forum|alt.badge.img+16
  • Scout
  • 904 replies
  • June 30, 2022

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. 

Translate

  • Author
  • 9 replies
  • June 30, 2022

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 🙂 

Translate

Garrett
Forum|alt.badge.img+16
  • Scout
  • 904 replies
  • June 30, 2022

@Cerys 

Click the Export button on the Designer toolbar

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

Send me that file.

 

 

 

 

Translate

  • Author
  • 9 replies
  • July 6, 2022
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.
Translate

  • Author
  • 9 replies
  • July 6, 2022
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! 🙂
Translate

Garrett
Forum|alt.badge.img+16
  • Scout
  • 904 replies
  • July 6, 2022

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

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings