cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Copy Excel row into new sheet based on date value

Hi,

 

I have a sheet with the columns #, Date, Channel, Category, Title.

 

I am trying to copy rows which have the 'Date' column greater than a deadline date into another new sheet. 

I have created a flow which runs successfully but doesnt update anything. Can someone please help me with this? 

 

Flow image below - 

 

Screenshot 2019-01-08 at 5.48.51 PM.png

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Copy Excel row into new sheet based on date value

Hi @mowgli512,

 

You could try to check Flow run history and check if the result of Condition action is true.

The "Add a row into a table" action is executed only when the condition is true, and then a new row is added to the other table.

I did a test on my side. If we want to compare the value of Date column with the date I input, the type of Date column needs to be text.

In Excel, the date is stored as a number. If the type of "Date" column is Date, the value displayed in Flow will be a number, and it cannot be compared.

So you need to make sure that “Date” column is of type text and then enter the date so that you could filter rows by comparing dates.

In addition, when configuring Condition in Flow, you need to ensure that the two dates have the same format. If they are different, you could set them to the same by using formatDateTime() function.

Expression:

@greater(items('Apply_to_each')?['Date'], formatDateTime(triggerBody()['date'], 'yyyy/MM/dd'))

Image reference:

4.PNG5.PNG

Please take a try again.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Frequent Visitor

Re: Copy Excel row into new sheet based on date value

Ok, got it to work with the below- 

 

@greaterOrEquals(formatDateTime(items('Apply_to_each')?['Date'], 'yyyy-MM-dd'), formatDateTime(triggerBody()['date'], 'yyyy-MM-dd'))

View solution in original post

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: Copy Excel row into new sheet based on date value

Hi @mowgli512,

 

You could try to check Flow run history and check if the result of Condition action is true.

The "Add a row into a table" action is executed only when the condition is true, and then a new row is added to the other table.

I did a test on my side. If we want to compare the value of Date column with the date I input, the type of Date column needs to be text.

In Excel, the date is stored as a number. If the type of "Date" column is Date, the value displayed in Flow will be a number, and it cannot be compared.

So you need to make sure that “Date” column is of type text and then enter the date so that you could filter rows by comparing dates.

In addition, when configuring Condition in Flow, you need to ensure that the two dates have the same format. If they are different, you could set them to the same by using formatDateTime() function.

Expression:

@greater(items('Apply_to_each')?['Date'], formatDateTime(triggerBody()['date'], 'yyyy/MM/dd'))

Image reference:

4.PNG5.PNG

Please take a try again.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Frequent Visitor

Re: Copy Excel row into new sheet based on date value

Hey Barry,

 

Thanks for the solution. I tried this and the flow runs successfully, but nothing copies over to the other table.

Highlighted
Frequent Visitor

Re: Copy Excel row into new sheet based on date value

It seems to only work when the date is in the below format

@greater(items('Apply_to_each')?['Date'], formatDateTime(triggerBody()['date'], 'yyyy-MM-dd'))

 

Is it not possible to use another date format such as dd/MM/yyyy?

Highlighted
Frequent Visitor

Re: Copy Excel row into new sheet based on date value

Ok, got it to work with the below- 

 

@greaterOrEquals(formatDateTime(items('Apply_to_each')?['Date'], 'yyyy-MM-dd'), formatDateTime(triggerBody()['date'], 'yyyy-MM-dd'))

View solution in original post

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (7,990)