cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Send an email to Share Point file owners if the file is expired

Hello,

 

I am completely new to Power Automate and I'd appreciate your help much.

 

I need to build a flow that sends emails to SharePoint file owners whose files have expired. The email should send one email for all expired files and include a list of links to expired files.

 

I have managed to create a flow that sends separate emails, but don't know how to combine them into one email to reduce inbox clutter.

 

Also, is there a way to exclude certain owners from this flow?

 

I would appreciate a detailed instructions if anyone could help. 🙂

 

Thanks a ton!

2 ACCEPTED SOLUTIONS

Accepted Solutions

Hi @andewmilorad ,

If your person column is a single-select person column, please see the following test.

In my scenario:

I don’t want to send expired document reminders to Bo Feng.

My SharePoint Library:

vyetonggumsft_4-1713175246344.png

My Outlook Inbox:

vyetonggumsft_9-1713176648559.png

 

I found that your 'Expiry Date' column name contains spaces. In the SharePoint list, if the column name contains special characters such as spaces, '/', '-', the display name and internal name of the column will be different, and in flow In both OData Filter and expressions, we need to refer to the internal name of the column.

Here is the link to the steps to view the internal name of the column.

🔍How to Find the Internal Name of a SharePoint Column – Ellis Karim's Blog

My Flow:

vyetonggumsft_0-1713174782870.png

vyetonggumsft_6-1713175654633.png

 

Expiry_x0020_Date lt '@{utcNow('yyyy-MM-dd')}'
item()?['SME/Email']
union(body('Select'),body('Select'))

 

If you want to exclude three people please use this expression in Filter array advanced mode:

 

@And(not(contains(item()?['SME/Email'], 'Prefix1')),not(contains(item()?['SME/Email'], 'Prefix2')),not(contains(item()?['SME/Email'], 'Prefix3')))

 

vyetonggumsft_1-1713181540086.png

 

item()?['SME/Email']
item()?['{FilenameWithExtension}']
item()?['SME/DisplayName']
item()?['Expiry_x0020_Date']
replace(replace(replace(string(outputs('Compose')),'[',''),']',''),'"','')

 

Best Regards,

Sunshine Gu

View solution in original post

Hi @andewmilorad ,

I know the problem.

Change the output of compose in Apply to each to this formula.

split(replace(replace(replace(string(outputs('Compose')),'[',''),']',''),'"',''),',')

Then change the formula in 'Send an email' to this formula.

replace(replace(replace(items('Apply_to_each'),'[',''),']',''),'"','')

My Flow:

vyetonggumsft_2-1713523503226.png

My Outlook Inbox:

vyetonggumsft_1-1713523420305.png

Best Regards,

Sunshine Gu

View solution in original post

16 REPLIES 16
v-yetonggu-msft
Community Support
Community Support

Hi @andewmilorad ,

Could you show me a complete screenshot of your SharePoint list?

Private information can be coded.

Who do you need to exclude? Please describe your needs in detail.

 

Best Regards,

Sunshine Gu

Hello @v-yetonggu-msft - thank you for quick response! 🙂 

I need to automate sending emails to people in the "SME" column when the "expiry date" in their respective row has passed.

What's crucial is that, for example, if "Susan" in the table has multiple different documents, I don't want to send her 5 separate emails for each document. Instead, the automation should consolidate all the links to her expired documents into one email and send it.

However, I want to exclude 3 people listed as SME from receiving these emails across the entire SharePoint. For instance, in the example from the image, "Laszlo" shouldn't receive emails regarding this matter; in other words, I want to exclude him from this automation.

I would appreciate a detailed instructions if anyone could help. 

andewmilorad_2-1713170471853.png

Thanks a ton!

andewmilorad_1-1713170458190.png

 

Hi @andewmilorad ,

If your person column is a single-select person column, please see the following test.

In my scenario:

I don’t want to send expired document reminders to Bo Feng.

My SharePoint Library:

vyetonggumsft_4-1713175246344.png

My Outlook Inbox:

vyetonggumsft_9-1713176648559.png

 

I found that your 'Expiry Date' column name contains spaces. In the SharePoint list, if the column name contains special characters such as spaces, '/', '-', the display name and internal name of the column will be different, and in flow In both OData Filter and expressions, we need to refer to the internal name of the column.

Here is the link to the steps to view the internal name of the column.

🔍How to Find the Internal Name of a SharePoint Column – Ellis Karim's Blog

My Flow:

vyetonggumsft_0-1713174782870.png

vyetonggumsft_6-1713175654633.png

 

Expiry_x0020_Date lt '@{utcNow('yyyy-MM-dd')}'
item()?['SME/Email']
union(body('Select'),body('Select'))

 

If you want to exclude three people please use this expression in Filter array advanced mode:

 

@And(not(contains(item()?['SME/Email'], 'Prefix1')),not(contains(item()?['SME/Email'], 'Prefix2')),not(contains(item()?['SME/Email'], 'Prefix3')))

 

vyetonggumsft_1-1713181540086.png

 

item()?['SME/Email']
item()?['{FilenameWithExtension}']
item()?['SME/DisplayName']
item()?['Expiry_x0020_Date']
replace(replace(replace(string(outputs('Compose')),'[',''),']',''),'"','')

 

Best Regards,

Sunshine Gu

Hello @v-yetonggu-msf, thank you for the quick response! 🙂

I have few more questions: 
- How can I add a custom name for each SME at the beginning of the email? 

- How can I add a custom date "+14 days" for when they have to review the content?

andewmilorad_0-1713471560300.png

- Is there any way for the email received by the SME to display as "Item Name," with a hyperlink directly to the document, creating a short URL?

andewmilorad_1-1713473208945.png

 

Thank you! 

 

Hello @v-yetonggu-msf, thank you for the quick response! 🙂

I have a few more questions:

  • I have multiple SMEs, it prompts the following error: The 'inputs.parameters' of workflow operation 'Send_an_email_(V2)' of type 'OpenApiConnection' is not valid. Error details: Input parameter 'emailMessage/To' is required to be of type 'String/email'. The runtime value '"email1SME.com,email2SME.com" to be converted doesn't have the expected format 'string/email'.
    Every individual SME should receive only email and document for himself and not other included in it - I hope you understand what the issue is here.
    andewmilorad_0-1713475052463.png

     

  • How can I add a custom name for each SME at the beginning of the email?
  • How can I add a custom date "+14 days" for when they have to review the content?

Screenshot 2024-04-18 213555.jpg

  • Is there any way for the email received by the SME to display as "Item Name," with a hyperlink directly to the document, creating a short URL? 

Screenshot 2024-04-18 224552.png
Thanks a lot! 🙂 

Hi  @andewmilorad ,

First of all, your email address must be a valid email address, not a string written by yourself.

For example, all the email addresses in my test examples are the email addresses of employees of our company.

As for the rest of your problem, you can re-open a thread and attach a more detailed description so that more people in the forum can see it. This is more effective than me solving it alone.

Thank you for your understanding.

-------------------------------------------------------------------------------------------------------------------------------

If I solve your problem, please mark my response as a solution so I can help more people who are experiencing this challenge in the future. 

Best Regards,

Sunshine Gu

Hello @v-yetonggu-msft

Thank you for your response and guidance.

Just to clarify, I've used email addresses from our company, ensuring I haven't manually inputted anything. I've removed them from this post to protect my email address from being publicly available.

The problem in your solution that I have is when in one folder I have multiple SMEs, An error message appears: : The 'inputs.parameters' of workflow operation 'Send_an_email_(V2)' of type 'OpenApiConnection' is not valid. Error details: Input parameter 'emailMessage/To' is required to be of type 'String/email'. The runtime value '"email1SME.com,email2SME.com" to be converted doesn't have the expected format 'string/email'.

andewmilorad_0-1713475052463.png


Each individual SME should only receive an email and document intended for them. 

Regarding the remaining issues, I'll follow your suggestion and provide a more detailed description in a new thread to seek further assistance from the forum.

Once the issues are resolved, I'll make sure to mark your response as a solution.

Thank you once again for your support.

Best Regards,
Andrew

Hi @andewmilorad ,

Is your SME column a multi-select person column?

 

Best Regards,

Sunshine Gu

Hello @v-yetonggu-msft 
Please see below - no its not. Only one SME per document is allowed to be. 

andewmilorad_0-1713520277077.png

 

Hi @andewmilorad ,

Could you show me your 'replace' formula? I guess your formula is wrong.

 

Best Regards,

Sunshine Gu

Hi @v-yetonggu-msft 
This is formula that I put in section "TO" 

replace(replace(replace(string(outputs('Compose')),'[',''),']',''),'"','')
andewmilorad_0-1713520550418.png

Kind regards,

Andrew



Hi @andewmilorad ,

Please go to the flow running history and post a screenshot of the output of your compose.

Please do not block all email addresses.

You can block the domain name of the email address. 

Thank you for your cooperation.

Like this:

vyetonggumsft_0-1713521052955.png

Best Regards,

Sunshine Gu

Hello @v-yetonggu-msft 

 

Hope this is what are you looking for 🙂 

andewmilorad_0-1713521957310.png

 

Kind regards,

Andrew

Hi @andewmilorad ,

I know the problem.

Change the output of compose in Apply to each to this formula.

split(replace(replace(replace(string(outputs('Compose')),'[',''),']',''),'"',''),',')

Then change the formula in 'Send an email' to this formula.

replace(replace(replace(items('Apply_to_each'),'[',''),']',''),'"','')

My Flow:

vyetonggumsft_2-1713523503226.png

My Outlook Inbox:

vyetonggumsft_1-1713523420305.png

Best Regards,

Sunshine Gu

Thank you so much! 🙂 
Now everything works fine!! You are the best 

Hello @v-yetonggu-msft greatly appreciate your assistance with a few questions I have regarding its functionality. I'm hoping you can lend me a hand! 🙂 

My question are: 

  • Custom Name for SMEs in Email: How can I add a custom name for each Subject Matter Expert (SME) at the beginning of the email?
  • Custom Date for Review Deadline: Is there a way to add a custom date that is "+14 days" from the current date for when the SMEs have to review the content?

andewmilorad_0-1716380789283.jpeg

 

  • Hyperlinking "Item Name" in Email: Is it possible for the email received by the SMEs to display as "Item Name" with a hyperlink directly to the document, creating a short URL?

andewmilorad_1-1716380789227.png

 

  • Error Handling with Multiple SMEs: Additionally, when I have multiple SMEs, it prompts the following error: "Every individual SME should receive only email and document for himself." How can I resolve this issue?

    andewmilorad_2-1716380789239.png

     

I would highly appreciate detailed instructions or any insights you could provide to help me navigate through these challenges.

Thank you all in advance for your support!

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (1,433)