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 / Delete reports from th...
Power Automate
Answered

Delete reports from the sharepoint site that are older than 7 days | ExpressionEvaluationFail

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hey folks,

 

I'm very new to power automate and I use it in my company to accomplish two things:

 

  • Transfer Salesforce reports that are mail attachments to a sharepoint site
  • Delete reports from the sharepoint site that are older than 7 days

 

First task works like a charm but deleting the older files throws an error.

I did hack together this flow using tutorials online, so there is a very high chance that I copy/pasted something wrong.

I can interpret what the expressions mean that I pasted, I'm just not practised enough to write them.

 

 

 

dschafar87_0-1647938529163.png

 

dschafar87_1-1647938591444.png

 

 

Fehler beim Ausführen der Vorlagenaktion "Auf_alle_anwenden". Das Ergebnis der Auswertung des foreach-Ausdrucks "@items('Auf_alle_anwenden_2')?['Modified']" weist den Typ "String" auf. Das Ergebnis muss ein gültiges Array sein.

 

Sorry for the error messages in German.

 

The expressions that I'm using are

 

utcNow('yyyyMMdd')

formatDateTime(adddays(item()?['Created'], 7), 'yyyyMMdd')

 

May someone has an idea.

 

Thank you!

 

 

Categories:
I have the same question (0)
  • abm abm Profile Picture
    32,985 Most Valuable Professional on at

    Hi @Anonymous 

     

    I can see you have two loops in your  screenshot you provided. Are you sure you mapping the right values? Only one loop is needed. First the Get Items and iterating the records for the filter.

     

    Watch my tutorial video about filter dates in SharePoint.

     

    https://www.youtube.com/watch?v=FRKtB37hJ4g&t=103s

     

    Thanks

  • KvB1 Profile Picture
    1,596 on at

    You would make your life a lot easier if you just compared

     

    Created gt addDays(utcNow(),-7)

     

    as an odata filter query in the get files properties action

     

    You would get the files where the created date is bigger than 7 days before today

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    If I do that, I get a "Bad request" Sorry If I set it up wrong

     

    2022_03_22_11_54_27_Ausführungsverlauf_Power_Automate.png

  • Verified answer
    KvB1 Profile Picture
    1,596 on at

    Yeah, have to add some fluff so PA can understand the filter

     

    Created gt '@{addDays(utcNow(),-7)}'

  • abm abm Profile Picture
    32,985 Most Valuable Professional on at

    Hi @Anonymous 

     

    If you are a beginner in PowerAutomate I would say see my video and try the same example. Once you understood you can change the filter accordingly. 

     

    Thanks

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 67

#2
David_MA Profile Picture

David_MA 64 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 39 Most Valuable Professional

Last 30 days Overall leaderboard