web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Split string - body HT...
Power Automate
Answered

Split string - body HTTP request

(0) ShareShare
ReportReport
Posted on by 79

Hi,

 

I need some help on retrieving the value "Information Technology", good to know, the value is dynamic and user dependent.

So out of this:

 

{
 "d": {
 "GetUserProfilePropertyFor": "Information Technology"
 }
}

I need to end up with

 

Information Technology

HTTP.jpg

Categories:
  • Verified answer
    Jay-Encodian Profile Picture
    2,922 on at

    Hey @BenVdP 

    You need to parse the JSON using the 'Parse JSON' action:

    2.jpg

    The schema (noting you can just generate this automatically in the action):

    {
        "type": "object",
        "properties": {
            "d": {
                "type": "object",
                "properties": {
                    "GetUserProfilePropertyFor": {
                        "type": "string"
                    }
                }
            }
        }
    }

     and the outputs:

    3.jpg

    HTH

    Jay

  • BenVdP Profile Picture
    79 on at

    Hi @Jay-Encodian 

     

    Not sure what you mean, can you go into a bit more detail?

     

    Thanks.

  • Paulie78 Profile Picture
    8,424 Moderator on at

    You can simply do this:

    getJSONval.PNG

    The code in the 2nd compose which exposes your value exactly is:

    outputs('Send_an_HTTP_request_to_SharePoint')['d']['GetUserProfilePropertyFor']
  • Jay-Encodian Profile Picture
    2,922 on at

    Hey @BenVdP 

    What part don't you follow? the screen shots explain all?

    HTH

    Jay

  • BenVdP Profile Picture
    79 on at

    @Jay-Encodian , it took a while for the screenshots to display. 

    Your proposed solution works! Thank you!

     

    One additional question; It would be nice that I could retrieve multiple attributes (CompanyPeopleUnitId, BusinessSectorName, BusinessUnitName, and DepartmentName)  in one call at once, is this something that can work as well?

    <?xml version="1.0" encoding="utf-8"?>
    <entry xml:base="https://COMPANY.sharepoint.com/teams/SPSITE/_api/"
     xmlns="http://www.w3.org/2005/Atom"
     xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
     xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
     xmlns:georss="http://www.georss.org/georss"
     xmlns:gml="http://www.opengis.net/gml">
     <id>https://COMPANY.sharepoint.com/teams/SPSITE/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)</id>
     <category term="SP.UserProfiles.PersonProperties" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
     <link rel="edit" href="SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)" />
     <title />
     <updated>2020-11-06T15:29:56Z</updated>
     <author>
     <name />
     </author>
     <content type="application/xml">
     <m:properties>
     <d:AccountName>i:0#.f|membership|USERID@COMPANY.com</d:AccountName>
     <d:DirectReports m:type="Collection(Edm.String)">
     <d:element>i:0#.f|membership|USERID@COMPANY.com</d:element>
     </d:DirectReports>
     <d:DisplayName>DISPLAYNAME</d:DisplayName>
     <d:Email>EMAIL@COMPANY.com</d:Email>
     <d:ExtendedManagers m:type="Collection(Edm.String)">
     <d:element>i:0#.f|membership|USERID@COMPANY.com</d:element>
     </d:ExtendedManagers>
     <d:ExtendedReports m:type="Collection(Edm.String)">
     <d:element>i:0#.f|membership|USERID@COMPANY.com</d:element>
     </d:ExtendedReports>
     <d:IsFollowed m:type="Edm.Boolean">false</d:IsFollowed>
     <d:LatestPost m:null="true" />
     <d:Peers m:type="Collection(Edm.String)">
     <d:element>i:0#.f|membership|USERID@COMPANY.com</d:element>
     </d:Peers>
     <d:PersonalSiteHostUrl>https://COMPANY-my.sharepoint.com:443/</d:PersonalSiteHostUrl>
     <d:PersonalUrl>https://COMPANY-my.sharepoint.com/personal/USERID_COMPANY_com/</d:PersonalUrl>
     <d:PictureUrl>https://COMPANY-my.sharepoint.com:443/User%20Photos/Profile%20Pictures/USERID_COMPANY_com_MThumb.jpg?t=63628926724</d:PictureUrl>
     <d:Title>FUNCTION TITLE</d:Title>
     <d:UserProfileProperties>
     <d:element m:type="SP.KeyValue">
     <d:Key>COMPANYPeopleUnitId</d:Key>
     <d:Value>PeopleUnitID</d:Value>
     <d:ValueType>Edm.String</d:ValueType>
     </d:element>
     <d:element m:type="SP.KeyValue">
     <d:Key>BusinessSectorName</d:Key>
     <d:Value>BusinessSectorName</d:Value>
     <d:ValueType>Edm.String</d:ValueType>
     </d:element>
     <d:element m:type="SP.KeyValue">
     <d:Key>BusinessUnitName</d:Key>
     <d:Value>BusinessUnitName</d:Value>
     <d:ValueType>Edm.String</d:ValueType>
     </d:element>
     <d:element m:type="SP.KeyValue">
     <d:Key>DepartmentName</d:Key>
     <d:Value>DepartmentName</d:Value>
     <d:ValueType>Edm.String</d:ValueType>
     </d:element>
     </d:UserProfileProperties>
     <d:UserUrl>https://COMPANY-my.sharepoint.com:443/Person.aspx?accountname=i%3A0%23%2Ef%7Cmembership%7CUSERID%40COMPANY%2Ecom</d:UserUrl>
     </m:properties>
     </content>
    </entry>
  • Jay-Encodian Profile Picture
    2,922 on at

    Hey @BenVdP 

    I've marked this one as a solution, helps other find answers to the same question.

    Retrieving multiple attributes is fine, the same approach should work... it should be a case of parsing the JSON.

    If you need further guidance can you post a new query (mention me on the post via an @) with the same sample data you're working with

    HTH

    Jay

  • BenVdP Profile Picture
    79 on at

    For others interested in my follow-up question, visit this topic.

  • Jay-Encodian Profile Picture
    2,922 on at

    @BenVdP - I have replied to the other post

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 289

#2
11manish Profile Picture

11manish 282 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 119

Last 30 days Overall leaderboard