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.
//Display comments when selected date is 5 or less days from current Date
dateDiffDays(Current_Date, DateEvent) <= 5
HideCommentsRule
//Hide comments panel if EMPTY date
//Hide comments panel if Date Chosen is greater than 5
DateEvent == "" || dateDiffDays(Current_Date, DateEvent) > 5
//Display comments when selected date is 5 or less days from current Date
dateDiffDays(Current_Date, DateEvent) <= 5
HideCommentsRule
//Hide comments panel if EMPTY date
//Hide comments panel if Date Chosen is greater than 5
DateEvent == "" || dateDiffDays(Current_Date, DateEvent) > 5
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
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.
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?
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! 🙂
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.