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!

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (2,971)