cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RayRay
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
v-zhos-msft
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
v-zhos-msft
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
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 Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (24,472)