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

SharePoint item has been modified. But which columns?

When building solutions with Flow and SharePoint I often come across the same problem. The solution should do something every time the user updates item in SharePoint list. But this "something" depends on column user has updated.

 

Unfortunately, there is no action for this use case. You can call SharePoint Rest API from Flow and find the previous version of the list item. Compare it with the current one and figure out which fields the user has edited. Solved!

 

Sounds too complicated for me. You can achieve the same functionality way easier. Just store items previous values in another SharePoint list. By using Flow of course.  

 

Example - Order Processing

 

Let's build a light order processing solution using PowerApps + Sharepoint + Flow. Orders are stored in a SharePoint list having the following fields:

  • What has been ordered (Title)
  • Order status (Status)
  • The orderer (Created by)
  • Approver (Approver)
  • Comments related to the order (Comments)

orders.png

 

When order item is updated we like to do the following

  1. If the approver is changed -> Send a notification to the new approver
  2. If order status is updated - > Send notifications to the orderer and/or acquisition, depending on the updated status
  3. In other cases (for example, someone updates comments) -> Do nothing

First, we create a new list where previous values of each item are stored. For our example we need

  • Order status (Status)
  • Approver (Approver)

And of course, the original item id (OrderID).

 

orders-prevoious.png

 

Now we create a Flow that is triggered when a new order is placed. It creates a corresponding item in our history list.

 

orders-create-history-row.png

 

Now, whenever a new order is created in the order list.  

 

orders-create-history-row-example-1-e1535038963723.png

 

The corresponding item is created on our history list.

 

orders-create-history-row-example-2.png

 

Next, we create a Flow triggered whenever an order item is modified. The first action gets a matching item from our history list. This can be done by utilizing the OData filter.

 

modify-order.png

 

Now we can find out whether the order status is changed or not. In other words, whether the modified order line status is different from the status of the corresponding item on the history list.

 

order-is-status-changed.png

 

If the status is changed, we will do different actions depending on what the new status is (approved orrejected).

 

orders-modify-item-3.png

 

Next, we find out if approver has changed. If it is an e-mail notification is sent to the new approver. If the approver isn't changed we do nothing.

 

orders-modify-item-4.png

 

At the end of Flow, we update new values into the history list.

 

orders-modify-item-5.png

 

So straightforward that I almost feel ashamed.

 

Final Flow looks like this.

 

order-history-flow.png

 

Comments

In a newbie to Flow, and this has been what I was troubling with for the past month, glad I found your solution, it is so much simpler and I could understand the functions much better! Thank you!!

About the Author
  • Experienced Consultant with a demonstrated history of working in the information technology and services industry. Skilled in Office 365, Azure, SharePoint Online, PowerShell, Nintex, K2, SharePoint Designer workflow automation, PowerApps, Microsoft Flow, PowerShell, Active Directory, Operating Systems, Networking, and JavaScript. Strong consulting professional with a Bachelor of Engineering (B.E.) focused in Information Technology from Mumbai University.
  • I am a Microsoft Business Applications MVP and a Senior Manager at EY. I am a technology enthusiast and problem solver. I work/speak/blog/Vlog on Microsoft technology, including Office 365, Power Apps, Power Automate, SharePoint, and Teams Etc. I am helping global clients on Power Platform adoption and empowering them with Power Platform possibilities, capabilities, and easiness. I am a leader of the Houston Power Platform User Group and Power Automate community superuser. I love traveling , exploring new places, and meeting people from different cultures.
  • Read more about me and my achievements at: https://ganeshsanapblogs.wordpress.com/about MCT | SharePoint, Microsoft 365 and Power Platform Consultant | Contributor on SharePoint StackExchange, MSFT Techcommunity
  • Encodian Owner / Founder - Ex Microsoft Consulting Services - Architect / Developer - 20 years in SharePoint - PowerPlatform Fan
  • Founder of SKILLFUL SARDINE, a company focused on productivity and the Power Platform. You can find me on LinkedIn: https://linkedin.com/in/manueltgomes and twitter http://twitter.com/manueltgomes. I also write at https://www.manueltgomes.com, so if you want some Power Automate, SharePoint or Power Apps content I'm your guy 🙂
  • I am the Owner/Principal Architect at Don't Pa..Panic Consulting. I've been working in the information technology industry for over 30 years, and have played key roles in several enterprise SharePoint architectural design review, Intranet deployment, application development, and migration projects. I've been a Microsoft Most Valuable Professional (MVP) 15 consecutive years and am also a Microsoft Certified SharePoint Masters (MCSM) since 2013.
  • Big fan of Power Platform technologies and implemented many solutions.
  • Passionate #Programmer #SharePoint #SPFx #M365 #Power Platform| Microsoft MVP | SharePoint StackOverflow, Github, PnP contributor
  • Web site – https://kamdaryash.wordpress.com Youtube channel - https://www.youtube.com/channel/UCM149rFkLNgerSvgDVeYTZQ/