cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PeggyLang
Helper V
Helper V

Reference previous month in flow which posts message in Teams Channel

I have created a flow which posts in a Teams channel when a file is uploaded to a specific folder.

I would like to reference the previous to current month in my messge, however, do not know how to calculate/compose this information for insertion in my message.

For instance if a file is uploaded to 'xxx' folder on Sep 9, then the message I would like posted in the Teams channel is;

     'Aug data has been uploaded to 'xxx' folder for your use.'

And subsequently when a file is uploaded on Oct 9, then the message I would like posed in the Teams channel is;

     'Sep data has been uploaded to 'xxx' folder for your use.'

 

I'm guessing there is a way to do this, but other than ask here, I don't know where else to begin figuring it out.

1 ACCEPTED SOLUTION

Accepted Solutions
v-litu-msft
Community Support
Community Support

Hi @PeggyLang,

 

You could use the addToTime() function sub current time one month then convert it into "MMM" date format to get the short month, then store it into a string variable:

addToTime(utcNow(),-1,'month','MMM')

Annotation 2020-09-10 092845.jpg

 

Best Regards,
Community Support Team _ Lin Tu
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

3 REPLIES 3
v-litu-msft
Community Support
Community Support

Hi @PeggyLang,

 

You could use the addToTime() function sub current time one month then convert it into "MMM" date format to get the short month, then store it into a string variable:

addToTime(utcNow(),-1,'month','MMM')

Annotation 2020-09-10 092845.jpg

 

Best Regards,
Community Support Team _ Lin Tu
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

LOVE IT!
Thank you so much for the solution.  Works like a charm!

Perfect - I was looking for this solution to input the previous month's name also, and this worked. Thank you as well!

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,226)