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

Notifications

Announcements

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

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,865 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
    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,865 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard