cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Lon
Level: Powered On

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
Community Support Team
Community Support Team

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
Community Support Team
Community Support Team

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
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 343 members 5,773 guests
Please welcome our newest community members: