0

I have succeeded with an HTTP request to retrieve the group a person is a member of (see image). But if the person is a member of several groups in the same site collection, the Parse in the flow does not work. Please, can someone tell me how to get the information and for example, insert it to a SharePoint list or in an Excel file. HTTP request flow.

1 Answer 1

0

You probably can try use this schema.

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "Id": {
                "type": "integer"
            },
            "IsHiddenInUI": {
                "type": "boolean"
            },
            "LoginName": {
                "type": "string"
            },
            "Title": {
                "type": "string"
            },
            "PrincipalType": {
                "type": "integer"
            },
            "AllowMembersEditMembership": {
                "type": "boolean"
            },
            "AllowRequestToJoinLeave": {
                "type": "boolean"
            },
            "AutoAcceptRequestToJoinLeave": {
                "type": "boolean"
            },
            "Description": {},
            "OnlyAllowMembersViewMembership": {
                "type": "boolean"
            },
            "OwnerTitle": {
                "type": "string"
            },
            "RequestToJoinLeaveEmailSetting": {
                "type": "string"
            }
        },
        "required": [
            "Id",
            "IsHiddenInUI",
            "LoginName",
            "Title",
            "PrincipalType",
            "AllowMembersEditMembership",
            "AllowRequestToJoinLeave",
            "AutoAcceptRequestToJoinLeave",
            "Description",
            "OnlyAllowMembersViewMembership",
            "OwnerTitle",
            "RequestToJoinLeaveEmailSetting"
        ]
    }
}

There's a high chance that your data is not match with the generated schema in Parse JSON. Parse JSON will throw error only when the schema does not match with the submitted data in the content box.

pic

This could be one of the following reasons:

  1. The results type is inconsistent (example: an array if multiple, single object if return only 1). But I doubt this is the case since SharePoint REST API is quite consistent.
  2. There's a property that is listed under required in the schema, but there's no data in at least one of the objects in the entire array.

Now, the question come back to you, what is the schema in that Parse JSON? What is the Content? You can try to mouseover the uri that you put into Site and it will show the expression, may I know what's the expression of that?

2
  • The schema did not work. Got this message. [ { "message": "Invalid type. Expected Array but got Object.", "lineNumber": 0, "linePosition": 0, "path": "", "schemaId": "#", "errorType": "type", "childErrors": [] } ]
    – Dowi
    Commented Dec 30, 2022 at 10:44
  • Then it could be no 1, the results is inconsistent. Can you go to your flow history where it fails, then you go to open up the action of "Send an HTTP Request to SharePoint" then look up for the output, or click on the raw outputs, copy the entire JSON, then edit your flow, go to Parse JSON, click on generate JSON schema and paste the JSON there. It'll update your schema. Commented Dec 31, 2022 at 14:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.