cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
johnjohn123
Post Prodigy
Post Prodigy

How i can get the Group ID from the result i get when querying the User Info list

I am using the http request action to query the User Info List, as follow:-

 

user1.png

 

where i will get this json:-

 

 

 

 

 

 

{
  "d": {
    "results": [
      {
        "__metadata": {
          "id": "317f22e4-e00e-4068-a39f-83b2431ad069",
          "uri": "**/_api/Web/SiteUserInfoList/Items(28)",
          "etag": "\"1\"",
          "type": "SP.Data.UserInfoItem"
        },
        "FirstUniqueAncestorSecurableObject": {
          "__deferred": {
            "uri": "**/_api/Web/SiteUserInfoList/Items(28)/FirstUniqueAncestorSecurableObject"
          }
        },
        "RoleAssignments": {
          "__deferred": {
            "uri": "**/_api/Web/SiteUserInfoList/Items(28)/RoleAssignments"
          }
        },
        "AttachmentFiles": {
          "__deferred": {
            "uri": "**/_api/Web/SiteUserInfoList/Items(28)/AttachmentFiles"
          }
        },
        "ContentType": {
          "__deferred": {
            "uri": "**/_api/Web/SiteUserInfoList/Items(28)/ContentType"
          }
        },
        "GetDlpPolicyTip": {
          "__deferred": {
            "uri": "**/_api/Web/SiteUserInfoList/Items(28)/GetDlpPolicyTip"
          }
        },
        "FieldValuesAsHtml": {
          "__deferred": {
            "uri": "**/_api/Web/SiteUserInfoList/Items(28)/FieldValuesAsHtml"
          }
        },
        "FieldValuesAsText": {
          "__deferred": {
            "uri": "**/_api/Web/SiteUserInfoList/Items(28)/FieldValuesAsText"
          }
        },
        "FieldValuesForEdit": {
          "__deferred": {
            "uri": "**/_api/Web/SiteUserInfoList/Items(28)/FieldValuesForEdit"
          }
        },
        "File": {
          "__deferred": {
            "uri": "**/_api/Web/SiteUserInfoList/Items(28)/File"
          }
        },
        "Folder": {
          "__deferred": {
            "uri": "**/_api/Web/SiteUserInfoList/Items(28)/Folder"
          }
        },
        "LikedByInformation": {
          "__deferred": {
            "uri": "**/_api/Web/SiteUserInfoList/Items(28)/LikedByInformation"
          }
        },
        "ParentList": {
          "__deferred": {
            "uri": "**/_api/Web/SiteUserInfoList/Items(28)/ParentList"
          }
        },
        "Properties": {
          "__deferred": {
            "uri": "**/_api/Web/SiteUserInfoList/Items(28)/Properties"
          }
        },
        "Versions": {
          "__deferred": {
            "uri": "**/_api/Web/SiteUserInfoList/Items(28)/Versions"
          }
        },
        "FileSystemObjectType": 0,
        "Id": 28,
        "ServerRedirectedEmbedUri": null,
        "ServerRedirectedEmbedUrl": "",
        "ContentTypeId": "0x010C002FA85EC1D1060A439241C9C7930F396B",
        "Title": "testMsflowsendemails Members",
        "ComplianceAssetId": null,
        "Name": "c:0o.c|federateddirectoryclaimprovider|40a1ebac-06d3-44bc-9dfb-128383e0d3d4",
        "EMail": "testMsflowsendemails@*****.onmicrosoft.com",
        "OtherMail": null,
        "UserExpiration": null,
        "UserLastDeletionTime": null,
        "MobilePhone": null,
        "Notes": null,
        "SipAddress": null,
        "IsSiteAdmin": false,
        "Deleted": false,
        "UserInfoHidden": false,
        "Picture": null,
        "Department": null,
        "JobTitle": null,
        "FirstName": null,
        "LastName": null,
        "WorkPhone": null,
        "UserName": null,
        "WebSite": null,
        "SPSResponsibility": null,
        "Office": null,
        "SPSPictureTimestamp": null,
        "SPSPicturePlaceholderState": null,
        "SPSPictureExchangeSyncState": null,
        "ID": 28,
        "Modified": "2021-02-03T14:28:31Z",
        "Created": "2021-02-03T14:28:31Z",
        "AuthorId": 6,
        "EditorId": 6,
        "OData__UIVersionString": "1.0",
        "Attachments": false,
        "GUID": "43c1604f-c379-4ec3-9ded-6c22f66d8b6f"
      }
    ]
  }
}

 

 

 

 

 

Now i want to query the members of the above group using the "List Group Members" action >> but to do so i need to pass the Group Id, based on my search the above ID is not what i need, but the what i need is the ID inside the name which is 40a1ebac-06d3-44bc-9dfb-128383e0d3d4.. so i have these 2 questions:-

 

1) what is the ID needed to be passed to the "List Group Members" action?

2) If the ID is part of the name, then how i can extract the Id from the above JSON?

1 ACCEPTED SOLUTION

Accepted Solutions
tom_riha
Super User
Super User

Hello @johnjohn123 ,

1. you must pass the ID from the name as you mentioned, only the last part starting with 40...

"Name": "c:0o.c|federateddirectoryclaimprovider|40a1ebac-06d3-44bc-9dfb-128383e0d3d4",

 2. the simplest way to get the ID would be to parse the JSON using the 'Parse JSON' action, that will give you access to the 'Name' value. Then I'd parse it from the 'Name' with the split(...) expression: split it by the '|' character and take the 3rd part from the split

split(items('Apply_to_each')?['Name'],'|')[2]

image.png

 

...or if you want to get fancy, you can use a single expression to navigate trough the JSON to get the 'Name' and then split it

split(outputs('Send_an_HTTP_request_to_SharePoint')?['body']['d']['results'][0]['name'],'|')[2]

image.png



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

1 REPLY 1
tom_riha
Super User
Super User

Hello @johnjohn123 ,

1. you must pass the ID from the name as you mentioned, only the last part starting with 40...

"Name": "c:0o.c|federateddirectoryclaimprovider|40a1ebac-06d3-44bc-9dfb-128383e0d3d4",

 2. the simplest way to get the ID would be to parse the JSON using the 'Parse JSON' action, that will give you access to the 'Name' value. Then I'd parse it from the 'Name' with the split(...) expression: split it by the '|' character and take the 3rd part from the split

split(items('Apply_to_each')?['Name'],'|')[2]

image.png

 

...or if you want to get fancy, you can use a single expression to navigate trough the JSON to get the 'Name' and then split it

split(outputs('Send_an_HTTP_request_to_SharePoint')?['body']['d']['results'][0]['name'],'|')[2]

image.png



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

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!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,513)