cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KLD
Helper I
Helper I

How to get a specific attribute from the json body of a SharePoint http request action?

I have a SharePoint http request action to get the contenttypeId in a SharePoint document library. I got succesfully a response with this json body:

 

 

 

{
  "d": {
    "results": [
      {
        "__metadata": {
          "id": "https://myCompany.sharepoint.com/sites/DMS-WF-Test-Infra/_api/Web/Lists(guid'3baf0222-44af-4e58-8c1d-09b9e7dc2150')/ContentTypes('0x0101000004F8C10F56FF4D9C039461496B730801009F1920E0F876EA45B30C7BB091E9FE5A')",
          "uri": "https://myCompany.sharepoint.com/sites/DMS-WF-Test-Infra/_api/Web/Lists(guid'3baf0222-44af-4e58-8c1d-09b9e7dc2150')/ContentTypes('0x0101000004F8C10F56FF4D9C039461496B730801009F1920E0F876EA45B30C7BB091E9FE5A')",
          "type": "SP.ContentType"
        },
        "StringId": "0x0101000004F8C10F56FF4D9C039461496B730801009F1920E0F876EA45B30C7BB091E9FE5A"
      }
    ]
  }
}

 

 

How to get the attribute "StringId"? I see in another PowerAutomate they use d.results body('Send_an_HTTP_request_to_SharePoint_-_Get_ContentTypeID')?['d']?['results'] in a compose actibut I dont know how to use this formula.

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @KLD :

Use this formula as a value. The specific usage is as follows:

1.JPG2.JPG

Best Regards,

Bof

View solution in original post

3 REPLIES 3
v-bofeng-msft
Community Support
Community Support

Hi @KLD :

You can use this expression to get the value of "StringId" in this jsonbody:

body('Send_an_HTTP_request_to_SharePoint_-_Get_ContentTypeID')?['d']?['results'][0]['StringId']

Because 'result' is an array, you cannot directly reference the value of ['StringId']. You must use [0] to get the first element in this array, and then get the value of ['StringId'].

Best Regards,

Bof

Thanks @v-bofeng-msft . Which action do I need to use for this formula? And do I need to add this formula as a expression or as a normal value

v-bofeng-msft
Community Support
Community Support

Hi @KLD :

Use this formula as a value. The specific usage is as follows:

1.JPG2.JPG

Best Regards,

Bof

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,031)