cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mowgli512
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
v-bacao-msft
Community Support
Community Support

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

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
v-bacao-msft
Community Support
Community Support

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

Hey Barry,

 

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

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?

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
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (53,533)