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

add missing date

Hi,

I created a Flow with a Flic button. If I press the button, a new row with the current date, time and coordinates is added to an Excel table (Excel online OneDrive). This works already.

But if I forgot to press the button, the next timestamp is added directly below the last row. So these forgotten days are not displayed in the table.

 

current table.jpg

 

Is there a way to always compare the last row of the Excel table with the current date and automatically add the missing days before the next timestamp is added?

It should look like this:

 

that would be great.jpg

 

It would be really great if someone could help me with that.

 

Best regards

Ray

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-zhos-msft
Level 10

Re: add missing date

Hi @RayRay ,

First of all, the datetime string must match ISO 8601 format.

So you need set the date like yyyy-MM-dd or yyyy/MM/dd.

Second you need set the format of the Date as text.

Capture4.PNG

Then I have made a flow for your scenario, please check it for a reference.

The expression in compose is to get the last rowlast(body('List_rows_present_in_a_table')?['value']) 

The expression in compose 2 is to get the value of Date: outputs('Compose')?['Date']

The expression in compose 3 is to get the value of Date in this year: dayOfYear(outputs('Compose_2'))

The expression in compose 4 is to get the value of today in this year: dayOfYear(utcNow())

The expression in compose 5 is to compare the date and today: sub(outputs('Compose_4'),outputs('Compose_3'))

The expression in 'Add a row into a table' is: addDays(outputs('Compose_2'),variables('days'),'yyyy-MM-dd')

Capture5.PNGCapture6.PNGCapture7.PNG

Capture8.PNG

 

By the way, there is a simple method to avoid the missing.

You can use the 'Recurrence' trigger here, then set it run one times every day.

Capture9.PNG

Best Regards,

Community Support Team _ Zhongys

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

1 REPLY 1
v-zhos-msft
Level 10

Re: add missing date

Hi @RayRay ,

First of all, the datetime string must match ISO 8601 format.

So you need set the date like yyyy-MM-dd or yyyy/MM/dd.

Second you need set the format of the Date as text.

Capture4.PNG

Then I have made a flow for your scenario, please check it for a reference.

The expression in compose is to get the last rowlast(body('List_rows_present_in_a_table')?['value']) 

The expression in compose 2 is to get the value of Date: outputs('Compose')?['Date']

The expression in compose 3 is to get the value of Date in this year: dayOfYear(outputs('Compose_2'))

The expression in compose 4 is to get the value of today in this year: dayOfYear(utcNow())

The expression in compose 5 is to compare the date and today: sub(outputs('Compose_4'),outputs('Compose_3'))

The expression in 'Add a row into a table' is: addDays(outputs('Compose_2'),variables('days'),'yyyy-MM-dd')

Capture5.PNGCapture6.PNGCapture7.PNG

Capture8.PNG

 

By the way, there is a simple method to avoid the missing.

You can use the 'Recurrence' trigger here, then set it run one times every day.

Capture9.PNG

Best Regards,

Community Support Team _ Zhongys

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

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: 376 members 3,961 guests
Please welcome our newest community members: