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 / Create CSV from ShareP...
Power Automate
Answered

Create CSV from SharePoint List with Condition

(0) ShareShare
ReportReport
Posted on by 52

Hello,

 

I had a flow set on a recurrence that gets items from a SharePoint list, creates a CSV, stores it in a different SharePoint list, and then deletes the entries that have been copied to the CSV. It was working fine but then I added a condition based on the start date of the entries. Now, it is creating a separate CSV for each entry that meet the condition instead of creating one CSV for all entries. 

 

CSV Copy.PNG

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,830 Most Valuable Professional on at

    Hi @kayakingaway,

     

    Instead of your condition action you could also use either a Filter Query (OData) in your Get items or a Filter Array action.

     

    The Filter Array action looks pretty similar to the condition. So, that is probably the easiest to use.

     

    Below is an example of that Filter Array approach.

    As you can see you don't need an apply to each loop within this approach.

     

    filterarray_action.png

  • kayakingaway Profile Picture
    52 on at

    Thanks for the suggestion! I tried this out and it did solve the issue of the separate CSVs but it is pulling all my data into the CSV not just the data entries fitting the date filter array written as followed: 

    formatDateTime(addDays(utcNow(), -14), 'yyyy-MM-dd'). I tried to create the CSV from Body and from value with same issue. Any ideas? I appreciate the help!
  • kayakingaway Profile Picture
    52 on at

    The data entries fitting my date filter array**

  • Verified answer
    Expiscornovus Profile Picture
    33,830 Most Valuable Professional on at

    Hi @kayakingaway,

     

    With the current filter you are retrieving all the items which have a start date which is 2022-03-25 or before that date (today-14). 

     

    Which rows are you trying to retrieve? Based on your expression I assume all items which have a Start Date from 2022-03-25 till today?

     

    In that case you could use an expression in the advanced mode of the Filter Array action like below:

     

     

    @and(greaterOrEquals(item()?['StartDate'], formatDateTime(addDays(utcNow(), -14), 'yyyy-MM-dd')),lessOrEquals(item()?['StartDate'], formatDateTime(utcNow(), 'yyyy-MM-dd')))

     

     

    filterarray_advancedmode_expression.png

     

  • kayakingaway Profile Picture
    52 on at

    Those would be the correct rows that I want to pull but the CSV being created is pulling all the data currently in the SharePoint List. 

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 550

#2
Valantis Profile Picture

Valantis 390

#3
11manish Profile Picture

11manish 348

Last 30 days Overall leaderboard