cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Compare SharePoint "HTTP Request"-Body and Filter

Hi all,

 

I want to notify the creator of a SharePoint List item when someone else is editing the item.
Additionally it should be shown which attribute has been changed.

So far, I'm using "http-Request" to get all versions of the affected item.
My problem:
How do I filter out the individual versions and how can I compare them with each other?

 

This is my http-request:

ErrorFlow.png

 

Thats what comes out(i deleted some private attributes...):

 

{
  "value": [
    {
      "Created": "2019-08-07T11:44:23",
      "IsCurrentVersion": true,
      "VersionId": 3584,
      "VersionLabel": "7.0",
      "ContentTypeId": {
        "StringValue": "0x01008AAB5C1AF65CFE439CA15ADE66F0FEC1"
      },
      "Title": "Test-Ticket",
      "OData__x005f_ModerationComments": null,
      "File_x005f_x0020_x005f_Type": null,
      "ComplianceAssetId": null,
      "Art": "Ticket",
      "Beschreibung": "<p>ZWEITER TEST<br></p>",
      "OData__x005f_HasCopyDestinations": null,
    },
    {
      "Created": "2019-08-06T14:50:15",
      "IsCurrentVersion": false,
      "VersionId": 3072,
      "VersionLabel": "6.0",
      "ContentTypeId": {
        "StringValue": "0x01008AAB5C1AF65CFE439CA15ADE66F0FEC1"
      },
      "Title": "Test-Ticket",
      "OData__x005f_ModerationComments": null,
      "File_x005f_x0020_x005f_Type": null,
      "ComplianceAssetId": null,
      "Art": "Ticket",
      "Beschreibung": "<p>Dies ist ein Test</p>",
    },
  ]
}

According to my understanding I have to split the "body" and insert it into an array with a foreach loop.
There I should be able to compare the different array columns with each other and highlight differences.

But How?

 

Thanks!

Leon

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Compare SharePoint "HTTP Request"-Body and Filter

 

Hi @Lon ,

 

HTTP request action returns the data for all versions of the specified item as an array.

The data contained in each version is stored in every element of the array.

And sort by the version number, for example, the element whose index is 0 is stored in the latest version of the item.

Index is 1 is the data of the previous version.

 

For example, if you want to compare the latest version of Beschreibung with the previous version, you could refer to the following Expression.

Current version

body('HTTP')['d']['results'][0]['Beschreibung']

Previous version

body('HTTP')['d']['results'][1]['Beschreibung']

Besides, please check this blog and get more details about the version of the item:

Microsoft-Flow-Community-Blog/Check-for-a-Change-in-a-SharePoint-List-Column-Value

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Highlighted
Community Support
Community Support

Re: Compare SharePoint "HTTP Request"-Body and Filter

 

Hi @Lon ,

 

HTTP request action returns the data for all versions of the specified item as an array.

The data contained in each version is stored in every element of the array.

And sort by the version number, for example, the element whose index is 0 is stored in the latest version of the item.

Index is 1 is the data of the previous version.

 

For example, if you want to compare the latest version of Beschreibung with the previous version, you could refer to the following Expression.

Current version

body('HTTP')['d']['results'][0]['Beschreibung']

Previous version

body('HTTP')['d']['results'][1]['Beschreibung']

Besides, please check this blog and get more details about the version of the item:

Microsoft-Flow-Community-Blog/Check-for-a-Change-in-a-SharePoint-List-Column-Value

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
secondImage

August 2020 CYST Winners!

Check out the winners of the recent 'Can You Solve These?' community challenge!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (5,219)