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

Flow trigger to take action ONLY when status is changed

I think this is not possible, but want to be sure.  I want the following to occur:

 

-a specific column (Status) is changed to a specific value (Accepted) in my SP List

-It triggers an email notification to a user email

-It ONLY triggers this email when the status is changed to Accepted, not when other fields are updated (even tho the status is still Accepted)

 

I will have more than one (one for each Status) but right now, want to get this one working before I start rolling out to the rest...

 

Any ideas on how to make this happen as described?

 

Thanks!

Carole

6 REPLIES 6
Anonymous
Not applicable

Hello Carole,

 

Full disclosure: I was not able to get this to work myself; and my day job has gotten busy to the point that I can't really troubleshoot it anymore. But I think this should point you in the right direction, as I'm pretty sure the logic is sound. Maybe @ScottShearer , @Jcook , or another superuser would be able to be more specific, or point out what I'm missing here.

 

 

I think it is possible, you just might have to add a column to your SP list.

 

The issue with just creating a single trigger criteria to check "Status" for "Accepted" is that any subsequent changes to an item already set to "Accepted" will also return as true and trigger the flow to send the notification email.

 

If you create a new column in the list that stores a flag indicating whether or not the item has been marked "Accepted" already (I used a Yes/No column called "Already Accepted"; and set it to have a default value of "No"), you can add a second criteria in the trigger to make sure that the Item has not previously been set to "Accepted". So, the two trigger conditions are:

 

@equals(triggerBody()?['Status']?['value'],'Accepted') - Makes sure that the Status column value is "Accepted"

and

@equals(triggerBody()?['Already Accepted?'],false) - Makes sure that this is the first time that the Status Column value is "Accepted" (Yes/No columns have Boolean values, so Yes=True and No=False)

 

Then, as part of the flow itself, you update the item to set the "Already Accepted" to "Yes". Thus, the first time that the item's status is updated to "Accepted" will be the only time that the Flow will trigger for that item. Any change before the item is set as "Accepted", the criteria for the first trigger will not be met; and any change after the flow runs and the "Already Accepted" column is changed to "Yes", the criteria for the second trigger will not be met.

 

Here is are some screenshots from what I did:

 

To set the Trigger Criteria:Trigger Criteria1.png

 

 

 

Updating the Sharepoint Item:

Pull all other dynamic content from the Trigger so that nothing else changes when you update the "Already Accepted" fieldPull all other dynamic content from the Trigger so that nothing else changes when you update the "Already Accepted" field

I hope this helps you in the right direction. I'm sorry that I don't have a comprehensive solution.

 

Kyle

takolota
Multi Super User
Multi Super User

Also if anyone wants to do something or send an email whenever the status is changed to any other value, then you can use Davis’ solution above, but for the second column just create a copy of the Status column like a column called StatusCheck. Then you can set the trigger condition to if Status does not equal StatusCheck.

 

@not(equals(triggerBody()?['Status']?['value'], triggerBody()?['StatusCheck']?['value'])

 

Then you can put whatever you want in the flow as long as you end the flow by setting StatusCheck Value = Status Value in an update action.

That will trigger whenever the Status changes, then reset so it’s ready to trigger again the next time it changes.

eliotcole
Super User
Super User

I would imagine an alternative solution could exist if versioning is enabled on the SharePoint and only going when the field in question is updated. Might try that out now, actually! 😃

 

CPVain
Frequent Visitor

Hey Carole,

 

This is totally doable, as I have many of these status dependent email flows for my sharepoints. Here's a breakdown of how to build the flow:

 

Trigger: When an item or file is modified (link to your sharepoint and specific list. If you want to limit it down to a specific view to filter the column choices, you can but not totally needed) EDIT:(as pointed out by @takolota if you want to have that limited to not include updates after it has been switched to "Accepted", then definitely follow the example provided about using a second column to help filter out unneeded flow runs)

 

If you have any other fields from the sharepoint (like text fields) that you would like to include in the email, make sure to run them through any formatting translation expressions so they don't look weird on the email.

 

Next Step is to add Condition and set the input to the dynamic content for your column. So Status for input, then Is Equal To for the check, and Accepted for the value (you can set the value to whatever for the other options you have).

 

Then on the If Yes side of Condition, I would suggest using an HTTP request connector (doesn't require you to connect your Outlook and makes it look like a system email from your Sharepoint directly).

 

If you're unfamiliar with HTTP requests, here's a simple template:

 

Site address: Your sharepoint

 

Method: POST

 

Uri: _api/SP.Utilities.Utility.SendEmail

 

Headers: (this is displayed in a table format) First key= content-type, First value = application/json;odata=nometadata, then Second key = accept, Second value= application/json;odata=nometadata

 

Body: This is where you'll have to do some parsing for the actual email itself. Here's an example screenshot of what one of my test ones looked like:

CPVain_0-1630187158177.png

HTML tags will be important for the spacing and style of the actual "body" of the email. So the To section will be who you send the email to (sadly couldn't make it CC anyone, but no big deal). The Body is the body of the email. and Subject is the email subject.

 

Hope this helps! Let me know if something weird happens.

CPVain, doesn’t that trigger every time something is modified and doesn’t limit it to when the status changes?

 

The point of using trigger conditions on a second column or some other versioning set-up here is that it limits flow runs to just when the status is changed.

Depending on license, people only get a set number of actions every day, so using a regular condition here without trigger conditions means you’re using like 10x the number of actions per day for the same flow.

Thanks for pointing that out and I edited my response on the trigger portion. My usual assumption when statuses are changed to Accepted or some kind of "finished" status, then the item is either moved to a non-default view or sent to a database to be stored and the list item deleted (at least that's how I set lists up, nothing worse than a lagging list when the item limit gets full).

Helpful resources

Announcements

Exclusive LIVE Community Event: Power Apps Copilot Coffee Chat with Copilot Studio Product Team

It's time for the SECOND Power Apps Copilot Coffee Chat featuring the Copilot Studio product team, which will be held LIVE on April 3, 2024 at 9:30 AM Pacific Daylight Time (PDT).     This is an incredible opportunity to connect with members of the Copilot Studio product team and ask them anything about Copilot Studio. We'll share our special guests with you shortly--but we want to encourage to mark your calendars now because you will not want to miss the conversation.   This live event will give you the unique opportunity to learn more about Copilot Studio plans, where we’ll focus, and get insight into upcoming features. We’re looking forward to hearing from the community, so bring your questions!   TO GET ACCESS TO THIS EXCLUSIVE AMA: Kudo this post to reserve your spot! Reserve your spot now by kudoing this post.  Reservations will be prioritized on when your kudo for the post comes through, so don't wait! Click that "kudo button" today.   Invitations will be sent on April 2nd.Users posting Kudos after April 2nd at 9AM PDT may not receive an invitation but will be able to view the session online after conclusion of the event. Give your "kudo" today and mark your calendars for April 3, 2024 at 9:30 AM PDT and join us for an engaging and informative session!

Tuesday Tip: Unlocking Community Achievements and Earning Badges

TUESDAY TIPS are our way of communicating helpful things we've learned or shared that have helped members of the Community. Whether you're just getting started or you're a seasoned pro, Tuesday Tips will help you know where to go, what to look for, and navigate your way through the ever-growing--and ever-changing--world of the Power Platform Community! We cover basics about the Community, provide a few "insider tips" to make your experience even better, and share best practices gleaned from our most active community members and Super Users.   With so many new Community members joining us each week, we'll also review a few of our "best practices" so you know just "how" the Community works, so make sure to watch the News & Announcements each week for the latest and greatest Tuesday Tips!     THIS WEEK'S TIP: Unlocking Achievements and Earning BadgesAcross the Communities, you'll see badges on users profile that recognize and reward their engagement and contributions. These badges each signify a different achievement--and all of those achievements are available to any Community member! If you're a seasoned pro or just getting started, you too can earn badges for the great work you do. Check out some details on Community badges below--and find out more in the detailed link at the end of the article!       A Diverse Range of Badges to Collect The badges you can earn in the Community cover a wide array of activities, including: Kudos Received: Acknowledges the number of times a user’s post has been appreciated with a “Kudo.”Kudos Given: Highlights the user’s generosity in recognizing others’ contributions.Topics Created: Tracks the number of discussions initiated by a user.Solutions Provided: Celebrates the instances where a user’s response is marked as the correct solution.Reply: Counts the number of times a user has engaged with community discussions.Blog Contributor: Honors those who contribute valuable content and are invited to write for the community blog.       A Community Evolving Together Badges are not only a great way to recognize outstanding contributions of our amazing Community members--they are also a way to continue fostering a collaborative and supportive environment. As you continue to share your knowledge and assist each other these badges serve as a visual representation of your valuable contributions.   Find out more about badges in these Community Support pages in each Community: All About Community Badges - Power Apps CommunityAll About Community Badges - Power Automate CommunityAll About Community Badges - Copilot Studio CommunityAll About Community Badges - Power Pages Community

Tuesday Tips: Powering Up Your Community Profile

TUESDAY TIPS are our way of communicating helpful things we've learned or shared that have helped members of the Community. Whether you're just getting started or you're a seasoned pro, Tuesday Tips will help you know where to go, what to look for, and navigate your way through the ever-growing--and ever-changing--world of the Power Platform Community! We cover basics about the Community, provide a few "insider tips" to make your experience even better, and share best practices gleaned from our most active community members and Super Users.   With so many new Community members joining us each week, we'll also review a few of our "best practices" so you know just "how" the Community works, so make sure to watch the News & Announcements each week for the latest and greatest Tuesday Tips!   This Week's Tip: Power Up Your Profile!  🚀 It's where every Community member gets their start, and it's essential that you keep it updated! Your Community User Profile is how you're able to get messages, post solutions, ask questions--and as you rank up, it's where your badges will appear and how you'll be known when you start blogging in the Community Blog. Your Community User Profile is how the Community knows you--so it's essential that it works the way you need it to! From changing your username to updating contact information, this Knowledge Base Article is your best resource for powering up your profile.     Password Puzzles? No Problem! Find out how to sync your Azure AD password with your community account, ensuring a seamless sign-in. No separate passwords to remember! Job Jumps & Email Swaps Changed jobs? Got a new email? Fear not! You'll find out how to link your shiny new email to your existing community account, keeping your contributions and connections intact. Username Uncertainties Unraveled Picking the perfect username is crucial--and sometimes the original choice you signed up with doesn't fit as well as you may have thought. There's a quick way to request an update here--but remember, your username is your community identity, so choose wisely. "Need Admin Approval" Warning Window? If you see this error message while using the community, don't worry. A simple process will help you get where you need to go. If you still need assistance, find out how to contact your Community Support team. Whatever you're looking for, when it comes to your profile, the Community Account Support Knowledge Base article is your treasure trove of tips as you navigate the nuances of your Community Profile. It’s the ultimate resource for keeping your digital identity in tip-top shape while engaging with the Power Platform Community. So, dive in and power up your profile today!  💪🚀   Community Account Support | Power Apps Community Account Support | Power AutomateCommunity Account Support | Copilot Studio  Community Account Support | Power Pages

Super User of the Month | Chris Piasecki

In our 2nd installment of this new ongoing feature in the Community, we're thrilled to announce that Chris Piasecki is our Super User of the Month for March 2024. If you've been in the Community for a while, we're sure you've seen a comment or marked one of Chris' helpful tips as a solution--he's been a Super User for SEVEN consecutive seasons!   Since authoring his first reply in April 2020 to his most recent achievement organizing the Canadian Power Platform Summit this month, Chris has helped countless Community members with his insights and expertise. In addition to being a Super User, Chris is also a User Group leader, Microsoft MVP, and a featured speaker at the Microsoft Power Platform Conference. His contributions to the new SUIT program, along with his joyous personality and willingness to jump in and help so many members has made Chris a fixture in the Power Platform Community.   When Chris isn't authoring solutions or organizing events, he's actively leading Piasecki Consulting, specializing in solution architecture, integration, DevOps, and more--helping clients discover how to strategize and implement Microsoft's technology platforms. We are grateful for Chris' insightful help in the Community and look forward to even more amazing milestones as he continues to assist so many with his great tips, solutions--always with a smile and a great sense of humor.You can find Chris in the Community and on LinkedIn. Thanks for being such a SUPER user, Chris! 💪 🌠  

Tuesday Tips: Community Ranks and YOU

TUESDAY TIPS are our way of communicating helpful things we've learned or shared that have helped members of the Community. Whether you're just getting started or you're a seasoned pro, Tuesday Tips will help you know where to go, what to look for, and navigate your way through the ever-growing--and ever-changing--world of the Power Platform Community! We cover basics about the Community, provide a few "insider tips" to make your experience even better, and share best practices gleaned from our most active community members and Super Users.   With so many new Community members joining us each week, we'll also review a few of our "best practices" so you know just "how" the Community works, so make sure to watch the News & Announcements each week for the latest and greatest Tuesday Tips!This Week: Community Ranks--Moving from "Member" to "Community Champion"   Have you ever wondered how your fellow community members ascend the ranks within our community? What sets apart an Advocate from a Helper, or a Solution Sage from a Community Champion? In today’s #TuesdayTip, we’re unveiling the secrets and sharing tips to help YOU elevate your ranking—and why it matters to our vibrant communities. Community ranks serve as a window into a member’s role and activity. They celebrate your accomplishments and reveal whether someone has been actively contributing and assisting others. For instance, a Super User is someone who has been exceptionally helpful and engaged. Some ranks even come with special permissions, especially those related to community management. As you actively participate—whether by creating new topics, providing solutions, or earning kudos—your rank can climb. Each time you achieve a new rank, you’ll receive an email notification. Look out for the icon and rank name displayed next to your username—it’s a badge of honor! Fun fact: Your Community Engagement Team keeps an eye on these ranks, recognizing the most passionate and active community members. So shine brightly with valuable content, and you might just earn well-deserved recognition! Where can you see someone’s rank? When viewing a post, you’ll find a member’s rank to the left of their name.Click on a username to explore their profile, where their rank is prominently displayed. What about the ranks themselves? New members start as New Members, progressing to Regular Visitors, and then Frequent Visitors.Beyond that, we have a categorized system: Kudo Ranks: Earned through kudos (teal icons).Post Ranks: Based on your posts (purple icons).Solution Ranks: Reflecting your solutions (green icons).Combo Ranks: These orange icons combine kudos, solutions, and posts. The top ranks have unique names, making your journey even more exciting! So dive in, collect those kudos, share solutions, and let’s see how high you can rank!  🌟 🚀   Check out the Using the Community boards in each of the communities for more helpful information!  Power Apps, Power Automate, Copilot Studio & Power Pages

Find Out What Makes Super Users So Super

We know many of you visit the Power Platform Communities to ask questions and receive answers. But do you know that many of our best answers and solutions come from Community members who are super active, helping anyone who needs a little help getting unstuck with Business Applications products? We call these dedicated Community members Super Users because they are the real heroes in the Community, willing to jump in whenever they can to help! Maybe you've encountered them yourself and they've solved some of your biggest questions. Have you ever wondered, "Why?"We interviewed several of our Super Users to understand what drives them to help in the Community--and discover the difference it has made in their lives as well! Take a look in our gallery today: What Motivates a Super User? - Power Platform Community (microsoft.com)

Users online (4,559)