cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,857)