SharePoint List View Filter

Albert Hockaday 1 Reputation point
2022-05-19T16:21:53.85+00:00

I currently have a List view filter that displays only the items taking place over the next 7 days from Today, but the customer would like to have another list view filter that only displays the items that fall between Monday and Friday of next week based on the start date column. Is there a way that no matter if [Today] is Monday, Tuesday, Wednesday, Thursday or Friday to only show the items with a stat date between Monday and Friday of the following week and not the event s that start the remaining days of that week?

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,047 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,190 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Xuyan Ding - MSFT 7,586 Reputation points
    2022-05-25T02:00:43.273+00:00

    Hi @Albert Hockaday ,

    Because the time range is limited to Monday to Friday of the next week, you could not use [Today] to limit the selection range. So you can try to create a flow as a workaround.
    The overall idea is: Add a flag column to the list to determine whether the start time of the item is within the range of the next Monday to Friday of the start date, and then filter the view according to the flag.
    1.If start date is the start time of the item, it can be judged whether the item is in it according to the time period from Monday to Friday next to the current time.
    2.If start date is set to display the next week, then there should be another item start time column to determine whether the item start time is in the next Monday to Friday of start date.

    The difference between the two lies in the comparison time that needs to be quoted in the next flow.
    a)If it is the first, use utcNow() when getting the time.
    205286-image.png
    b)If it is the second, refer to the start date when getting the time.
    205209-image.png

    Below are the specific steps for your reference:
    1)Create a flag column of type Y/N
    205287-image.png

    2)Create a flow->See your flows->Automated cloud flow->When an item is created->Create
    205268-screenshot-2022-05-20-154328.png
    205247-screenshot-2022-05-20-154400.png 205279-screenshot-2022-05-20-154439.png
    205236-screenshot-2022-05-20-154528.png

    3)Choose Site Address, List Name, View->New step->Set initialization variable: DayofWeek->Set initialization variable: Test1->Set initialization variable: Test2
    Formula for calculating the next Monday of the current or start date as a whole: [start date] - weekday([start date]) +8
    Formula for calculating the next Friday of the current or start date as a whole: [start date] + 7 - weekday([start date]) +6
    DayofWeek-- fx: dayOfWeek(utcNow())
    Test1 -- fx: addDays(utcNow(),mul(variables('DayofWeek'),-1))
    Test2 -- fx : addDays(variables('Test1'),8)
    205230-screenshot-2022-05-20-154621.png
    205188-image.png
    205248-image.png
    205280-image.png

    4)Condition: start date/item start time is in the range Monday to Friday.(the picture only limits the upper limit on Monday)
    205301-image.png

    5) Judgment condition: if it is within the range, the flag is yes
    205288-image.png

    6) When creating an item, it will judge. (the picture is executed according to the current time)
    205237-screenshot-2022-05-24-200531.png

    7) Finally, use the filter to filter according to the flag column


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.