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

Community site session details

Session Id :
Power Automate - Building Flows
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

I have the same question (0)
  • Verified answer
    Jay-Encodian Profile Picture
    2,920 on at
    Re: Split string - body HTTP request

    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
    Re: Split string - body HTTP request

    Hi @Jay-Encodian 

     

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

     

    Thanks.

  • Paulie78 Profile Picture
    8,418 Moderator on at
    Re: Split string - body HTTP request

    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,920 on at
    Re: Split string - body HTTP request

    Hey @BenVdP 

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

    HTH

    Jay

  • BenVdP Profile Picture
    79 on at
    Re: Split string - body HTTP request

    @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,920 on at
    Re: Split string - body HTTP request

    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
    Re: Split string - body HTTP request

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

  • Jay-Encodian Profile Picture
    2,920 on at
    Re: Split string - body HTTP request

    @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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 691 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 431 Moderator

#3
developerAJ Profile Picture

developerAJ 266

Last 30 days Overall leaderboard