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

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
Solution Sage
Solution Sage

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
Solution Sage
Solution Sage

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
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (42,532)