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

Automate Monthly Copy and append of SharePoint list

Hello,

I would like to automate the recycling of a list in sharepoint each month. We have a YTD list that is modified by a power app for stakeholders. What we need to do is Copy the previous month's (as filtered by "Period" column data. then append to the same list with  the current month listed in the "Period" variable.

 

Period is text of Month Name (Januray, February, etc.)

 

New to Power Automate so thanks for any tips.

 

Kyle

1 ACCEPTED SOLUTION

Accepted Solutions
KS772
Frequent Visitor

I figured it out. The way we did it was a current month number and a prior month number. We will add the year to associate with YoY change. 

 

We started with Current Month Number as expressed below:

int(utcNow('MM'))

 

The Current Month first day function below was needed to build the subsequent prior month:

startOfMonth(utcNow())

 

The Compose function we built created the integer for prior month through this expression:

int(formatDateTime(subtractFromTime(outputs('CurrentMonthFirstDay'),1,'Month'),'MM'))
 
We created the filter based on our Period (Month Number) in the List - where Period = Prior Month variable.
 
Thanks!

View solution in original post

3 REPLIES 3
alrez
Community Support
Community Support

Hi Kyle,

 

Looking through your requirements here it does seem possible, but this will have a lot of variable dynamic values this will need to be generated. It will require the lists to have all of the same naming conventions but it is possible.

A general idea: Trigger is a recurrence every month. Set a variable to UTC now. Grab the month from that variable and go to that select the list based off of the month and then you just need you grab the list items and copy them over to the next month.

 

If you need more 1 on 1 help with creating this you can always work with a partner who specializes in building flows.

 

Regards,

 

Alex

 

-------

 

Community Support Team _ Alex Rezac
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

KS772
Frequent Visitor

Thanks Alex.

We are almost there. We created a month number variable in the data and I just need to filter based on that being 1 less than the month from utcnow(). 

 

Really just trying to create something along the lines of int(utcnow('MM')) minus 1 but having issues finding the best formula to do it.

KS772
Frequent Visitor

I figured it out. The way we did it was a current month number and a prior month number. We will add the year to associate with YoY change. 

 

We started with Current Month Number as expressed below:

int(utcNow('MM'))

 

The Current Month first day function below was needed to build the subsequent prior month:

startOfMonth(utcNow())

 

The Compose function we built created the integer for prior month through this expression:

int(formatDateTime(subtractFromTime(outputs('CurrentMonthFirstDay'),1,'Month'),'MM'))
 
We created the filter based on our Period (Month Number) in the List - where Period = Prior Month variable.
 
Thanks!

View solution in original post

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!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,841)