cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Super User II
Super User II

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
Super User II
Super User II

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
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

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 (8,167)