cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mowgli512
Level: Powered On

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
Community Support Team
Community Support Team

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

mowgli512
Level: Powered On

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
Community Support Team
Community Support Team

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

mowgli512
Level: Powered On

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.

mowgli512
Level: Powered On

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?

mowgli512
Level: Powered On

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

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 4 members 3,994 guests
Please welcome our newest community members: