RedCloud Consulting
  • What We Do
    • Business Solutions & Intelligence
    • Delivery Excellence
    • Marketing & Sales
    • Privacy & Security
    • Strategy & Transformation
  • WHO WE ARE
    • MEET THE TEAM
  • CAREERS
  • COMMUNITY
  • HIGHLIGHTS
    • BLOG
    • CASE STUDIES
  • CONTACT
  • Sustainability

Power Automate Utilities: Getting Date and Time of a Particular Change

8/23/2023

 
Picture
There are often ad hoc needs that go beyond what is possible with a human clicking on their computer, or should be possible for productivity’s sake. For example, a need we ran into was capturing a datetime in a SharePoint list for when an item was approved. Done manually, this meant looking through the history version. That would be fine if it were for a few items. ​

The Concept

We needed to detect when a SharePoint item was approved. At first you may think that could be found with the earliest version where the Status column was equal to ‘Approved’. However, what happens when something is then set back to ‘In Review’ before being set to ‘Denied’ or ‘Approved’ again. That means we need to find the most recent time the Status column was changed to ‘Approved’. ​
Picture

Building the utility flow

At its most basic level, this utility flow only consists of three actions, which I’ll outline below. Before that, I’d like to show how we made the flow a true utility with the 5 required parameters: ​
Picture
  1. SharePoint Site URL: the base URL for the specific SharePoint site that holds the List 
  2. SharePoint List Name: the name of the List to be queried 
  3. Field Schema Name: the schema or logical name of the column, which may be different than the display name 
  4. Target Value: the value of the field you are interested in determining when it became that value 
  5. ID: the ID of the SharePoint item 
These are all critical to composing the SharePoint http requests that respond with version history information. 
So now let’s
get to the more exciting part of building the actions. As described above, we need to find the most recent version where the specified column does not equal the target value.
 ​
Picture
Following that step, you then find the most recent version where the specified column is equal to the target value but is also a later version than the version returned in the first http call. ​
Picture
Code snippet for the VersionId gt comparison: first(outputs('Get_first_non_target_version')?['body/value'])?['VersionId'] 
With that, you have all the information you need! The final step is responding back with the datetime of the change. This makes it possible to call this flow as a child flow and run it for numerous items! 

Suggestion: make a Utilities Solution that holds these types of Flows and share them with your team. ​
Picture
Response snippet: first(outputs('Get_last_target_version')?['body/value'])?['Modified'] 

​This isn’t
a complicated build, but it is incredibly useful when backfilling data. It can also be tweaked to restore information while not being able to restore an actual version.
 
Picture
If you’d like to use the Flow yourself, you’ll find the file below. You’ll also find a more thoroughly built out flow that takes into consideration many of the potential failure points. For example, what happens when the column isn’t found or when the item has never been set to the target value? 
I hope you all enjoy! More utilities are certainly to come. ​
Utility - Get Datetime of Specific Field Change
File Size: 3 kb
File Type: zip
Download File

Utility - Simplified Get Datetime of Specific Field Change
File Size: 3 kb
File Type: zip
Download File


Comments are closed.

    Categories

    All
    10 Min Spotlight
    A Day In The Life
    BI & Automation
    Community
    Employee Kudos
    Latest News
    Lunch & Learn
    Meet The Team
    Privacy & Security
    Sustainability
    Welcome To The Team

    Archives

    September 2023
    August 2023
    July 2023
    June 2023
    May 2023
    April 2023
    March 2023
    February 2023
    January 2023
    November 2022
    October 2022
    September 2022
    August 2022
    July 2022
    June 2022
    May 2022
    April 2022
    March 2022
    February 2022
    January 2022
    December 2021
    November 2021
    October 2021
    September 2021
    August 2021
    July 2021
    June 2021
    May 2021
    April 2021
    March 2021
    February 2021
    January 2021
    December 2020
    November 2020
    October 2020
    September 2020
    August 2020
    July 2020
    June 2020
    May 2020
    April 2020
    March 2020
    December 2019
    August 2019
    June 2019
    August 2018
    February 2018
    August 2017

    RSS Feed

Button to glassdoor page
Main Office:   425-305-4121​        |         info@redcloudconsulting.com
©2020 RedCloud Consulting, Inc.  |   All Rights Reserved.  |  Privacy Policy  |  Terms of Use 
  • What We Do
    • Business Solutions & Intelligence
    • Delivery Excellence
    • Marketing & Sales
    • Privacy & Security
    • Strategy & Transformation
  • WHO WE ARE
    • MEET THE TEAM
  • CAREERS
  • COMMUNITY
  • HIGHLIGHTS
    • BLOG
    • CASE STUDIES
  • CONTACT
  • Sustainability