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.
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.
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')))
The data entries fitting my date filter array**
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:
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.