web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Get Year and Month fro...
Power Automate
Unanswered

Get Year and Month from Filter Query Get Items

(0) ShareShare
ReportReport
Posted on by 219

Hi,

How would I extract the year and/or month from the created date of an SP item?

I plan to archive old items into another SP list but that would take some time to do it manually and I was hoping I can automate that.

For example, I would need to archive the items that were from 2020. It would be much better to include the month.

Categories:
  • SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

    @RLSid17 ,

     

    You could just create two calculated columns in SharePoint to achieve this.

    Your flow could then archive the items based on the two columns.

     

    SudeepGhatakNZ_0-1666254001918.png

    SudeepGhatakNZ_1-1666254061828.png

    SudeepGhatakNZ_2-1666254158204.png

     

     

  • RLSid17 Profile Picture
    219 on at

    I just checked and there was already a calculated column for getting the month and year but when I tried to run and it says it cannot use a calculated column:

    RLSid17_0-1666254557890.pngRLSid17_1-1666254618813.png

     

  • RLSid17 Profile Picture
    219 on at

    Just an update I tried filter array and that worked.

  • RLSid17 Profile Picture
    219 on at

    But it won't get the items from the filter array for me to delete and create an item to another list.

  • SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

    Oh no!

     

    Ok create two variables in Power Automate (Month and Year)

    And set Month with the expression formatDateTime(YourCreatedDateField,'MM')

    set Year with the expression formatDateTime(YourCreatedDateField,'YYYY')

     

    Use these variables in the oData Filter query.

     

  • RLSid17 Profile Picture
    219 on at

    Hi,

    Sorry for the late response and thank you for the reply, the trigger for this would be the manual trigger flow.

    How can I create the variables if there is no action to depend on?

  • jaina Profile Picture
    517 on at

    Hi @RLSid17, can you share how you solved this? What did you put in your filter array?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 330

#2
11manish Profile Picture

11manish 282 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 123

Last 30 days Overall leaderboard