Showing results for 
Search instead for 
Did you mean: 
New Member

Add data to table based on date past within past 2 days



Details of what I am trying to achieve:


Currently, I have automation retrieving a list of data & adding it into a workbook, as the functionality of that automation isn't smart enough to only give me only new data (it will pull the full list every day) I need to add a check before adding the data to a "final workbook" so that duplications are avoided.

I thought the logic would allow me to only add rows to the new table based on the date being within the last 48 hours - but this doesn't seem to be so simple.


Error message: ExpressionEvaluationFailed. The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@items('Apply_to_each_2')?['Date']' is of type 'String'. The result must be a valid array.




expression in the condition = 

addDays('1899-12-30',int(item()?['Date Found']),'yyyy-MM-dd')
is less than or equal too

Any help on how to best action this would be gratefully received. 
Super User
Super User

Hello @RMillichamp ,

there should be only one "Apply to each" loop, represented by the "value" got from the "List rows present in a table" action.

So, you should remove the "Apply to each" loop and maintain the "Apply to each 2" loop.


If I have answered your question, please mark my post as Solved.
If you like my response, please give it a Thumbs Up.





Super User
Super User

An alternative, @RMillichamp, would be to stop using an excel sheet to contain the data and create a SharePoint/Microsoft List to contain it.


This could then offer both a more apt place for the data contained within, have its own built in automations, then also allow you to more easily fire off Power Automate flows upon new or changed data. 🙂

Helpful resources

Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,486)