Forum Discussion
SharePoint Rule for Date Field
I have been looking for an answer to this but haven't been able to find any. I'm hoping this group can help. I have a field called "Desired Start Date." I am trying to set up a rule that warns the user when they select a date that is less than 7 days in the future. I've tried using the condition where "Desired Start Date" is less than now()+7 but that displays the message with every date selected. Even those greater than 7 days in the future. Any ideas? All assistance is appreciated.
4 Replies
- Analyst_NKCopper ContributorI figured it out. I created a field called minimum start date and used the adddays function to add 7 days to now(). Then I just had to make sure that the desired start date was less than the minimum start date in order to display my warning to the creator.
- DhirenMehtaMSFT
Microsoft
Analyst_NK That's great. I was just reviewing the documentation and found following documentation suggesting in the same direction. I hope this helps as a reference for any future work.
https://support.microsoft.com/en-us/office/add-formulas-and-functions-in-infopath-2010-a14c7efd-9884-4e09-9435-7e683666e7e5
- DhirenMehtaMSFT
Microsoft
Are you trying to use Conditional Formatting to show a warning message? If so, may be this might help.
https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting#formatting-items-based-on-arbitrary-dates-advanced
If not, can you please provide more details on what steps are you taking and what use case are you trying to implement? (i.e. When user is creating an item ?) . Also, are you using Infopath form and trying to set up a rule within Infopath form or are you using Power Apps form?- Analyst_NKCopper Contributor
DhirenMehtaMSFT I'm trying to have SharePoint show this warning when the user creates an item that is
less than 7 days in the future. I thought I could do something similar to the image attached. The problem
seems to be that it displays on every date, not just those dates that would fall between the date and 7 days from now.