cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lon
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
v-bacao-msft
Community Support
Community Support

 

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
v-bacao-msft
Community Support
Community Support

 

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.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (1,796)