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

Creating new elements on SharePoint from excel depending on date

Hi everyone,

 

I have an Excel file which is updated every 4 hours. As this updating changes the file constantly I want to build a flow to copy certain elements (at an specific hour) in a SharePoint list. The condition that determines which elements have to be copied is the Day colum. I want to copy all events that happened yesterday but I don't know how to do this. My doubst are:

  • What is the formula that gives the day of yesterday? I've tried with formatDateTime but I only achieved the day of today
  • How should I put the flow condition to achieve the info transfering?
  • It is necessary to adjust the format of the colum in excel and/or sharepoint?

Thank you very much!

 

Regards,

Masoud9

 

1 ACCEPTED SOLUTION

Accepted Solutions
manuelstgomes
Super User
Super User

Hi @Masoud9 

 

Let's tackle this into parts. First, the formula to get yesterday is the following:

addDays(startOfDay(utcNow()),-1)

You get the start of today's day and remove one day.

 

You can use the formula with a Condition where the right side you put your Day column from Excel and in the left the formula. Something like this:

Screenshot 2020-01-29 at 10.23.22.png

 

When inserting in SharePoint you need to insert a valid date so that Excel can store it. If your Day field is already a date you can use it and the date will be saved.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

View solution in original post

2 REPLIES 2
manuelstgomes
Super User
Super User

Hi @Masoud9 

 

Let's tackle this into parts. First, the formula to get yesterday is the following:

addDays(startOfDay(utcNow()),-1)

You get the start of today's day and remove one day.

 

You can use the formula with a Condition where the right side you put your Day column from Excel and in the left the formula. Something like this:

Screenshot 2020-01-29 at 10.23.22.png

 

When inserting in SharePoint you need to insert a valid date so that Excel can store it. If your Day field is already a date you can use it and the date will be saved.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

View solution in original post

@manuelstgomes It worked perfectly, thank you very much!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,366)