web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / need help with a littl...
Power Automate
Answered

need help with a little snip of code... if sharepoint status of item is ALREADY set to CLOSED, ignore and do nothing.

(0) ShareShare
ReportReport
Posted on by 359

Problem:

 

I have a flow when an existing item in Sharepoint is set to status: Deal Closed, then an email is sent. Problem is if I edit any other field in that item in the future, for example, name, start date, etc, it sends an email.

 

I need to make it so if the status changes to Deal Closed, then send an email, BUT check to see if the status is ALREADY Deal Closed. If the status is already Deal Closed, do nothing.

 

Below is my existing code.

 

 

When an existing item is modified in Sharepoint.

 

//Compose - status value

//Equals - @equals(triggerBody()?['Status']?['Value'],'Deal Closed')

Categories:
I have the same question (0)
  • David- Profile Picture
    1,254 on at

    I would add a yes/no field to your list named "Notification Sent" (or whatever you want) and set the default value to false/no. Then add this to your trigger condition to only run if the status is Deal Closed and notification sent is false. Then after you send the e-mail, update the item to set the Notification Sent field to true/yes.

     

    If you test this on existing items in your list, it will not work because the field will be null. You would need to update all your existing items in the list so the value is no/false.

  • cchan000 Profile Picture
    359 on at

    hi @David- , thanks for this. can you help me write the code for it?

  • Verified answer
    David- Profile Picture
    1,254 on at

    Your trigger conditions would look something like this from one of my flows where I am doing the same thing you want to achieve:

    David_0-1664283673968.png

    The first line is like what you already have for your status (@equals(triggerBody()?['Status']?['Value'],'Deal Closed')). Then the second line is the format for the true/false field. Just replace DRN with the internal name of the field you use for this.

  • cchan000 Profile Picture
    359 on at

    thanks @David- ! I was able to also create another step that auto check boxed the item once the script ran. thanks!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 339 Super User 2025 Season 2

#1
trice602 Profile Picture

trice602 339 Super User 2025 Season 2

#3
David_MA Profile Picture

David_MA 270 Super User 2025 Season 2

Last 30 days Overall leaderboard