cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Calculate The Date for Upcoming Friday

Hi Everyone, 

 

I am working on a flow where people will submit their weekly project reports into a SharePoint list via a tab in Teams.  Someone in the PMO will then be notified that a new report has been submitted and needs to be reviewed.  If it is approved I then want it to be deleted from the SharePoint list and moved to a folder on another SharePoint site in a specific folder.  I've got most of this working but I am having issues with one particular thing.

 

We organize these reports weekly and the folder name is based on the current Friday's date (i.e. this week's folder will be 20190315).  What I am wanting to do is when a report is approved have the flow calculate what the next Friday's date is and move the approved report to that folder.

 

Can anyone help me with this?  Is it even possible?

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
v-yamao-msft
Community Support
Community Support

Hi @Anonymous ,

 

Do you want to move an attachment stored in SharePoint list to another SharePoint site in a specific folder after approval?

 

Do you want the file to be uploaded to a folder with the name of next Friday’s date which is based on the current Friday’s date?

 

Please check the following flow for a reference.

 

To calculate what the next Friday’s date is, I have used three Compose actions.

By the way, the file is named as 20190315.xlsx,

In Compose, select the dynamic content DisplayName.

In Compose 2, input the following code to format the file name to a ISO format.

concat(take(outputs('Compose'),4),'-',take(skip(outputs('Compose'),4),2),'-',take(skip(outputs('Compose'),6),2))

In Compose 3, input the following code to add 7 days to the current Friday’s date:

addDays(outputs('Compose_2'),7,'yyyyMMdd')

In the action Create file, specify another site and configure the folder path as:

/Test1/Outputs(‘Compose_3’)

Then select display name and attachment content from the previous actions.

1.PNG2.PNG

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
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

2 REPLIES 2
v-yamao-msft
Community Support
Community Support

Hi @Anonymous ,

 

Do you want to move an attachment stored in SharePoint list to another SharePoint site in a specific folder after approval?

 

Do you want the file to be uploaded to a folder with the name of next Friday’s date which is based on the current Friday’s date?

 

Please check the following flow for a reference.

 

To calculate what the next Friday’s date is, I have used three Compose actions.

By the way, the file is named as 20190315.xlsx,

In Compose, select the dynamic content DisplayName.

In Compose 2, input the following code to format the file name to a ISO format.

concat(take(outputs('Compose'),4),'-',take(skip(outputs('Compose'),4),2),'-',take(skip(outputs('Compose'),6),2))

In Compose 3, input the following code to add 7 days to the current Friday’s date:

addDays(outputs('Compose_2'),7,'yyyyMMdd')

In the action Create file, specify another site and configure the folder path as:

/Test1/Outputs(‘Compose_3’)

Then select display name and attachment content from the previous actions.

1.PNG2.PNG

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
takolota
Super User
Super User

Also if anyone needs to get the date of the next monday, tuesday, friday, saturday... etc. Then you can use this example flow to continually get the date of any upcoming day of the week https://powerusers.microsoft.com/t5/Power-Automate-Cookbook/Date-of-Next-Chosen-Day-of-Week/td-p/146...

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (1,847)