Hi everyone,
I'm following along this post:
from @siddarth_v
I'm getting stuck at the step where I assign the user to the group I created in the previous step.
When it runs, it appears like Id is undefined or empty. When I do a compose statement on the Id, it is, in fact, empty.
This is the error message:
The expression "web/roleassignments/addroleassignment(principalid=, roledefid=1073741826)" is not valid.
clientRequestId: 59dc92bb-ad7f-479d-bdae-476bb179ce2b
serviceRequestId: 32ef2aa0-807d-1000-a49b-9448d00198c4
When I view the Parse JSON step above it shows the Id is 200.
Any thoughts as to what I should be using to collect the Id?
Hi @smorley
According to your screen capture, you have 2 "id" fields. Have you tried to use both?
Apart from that, can you check the json schema on the Parse Json action?
Regards,
Ferran
Hi @fchopo , I have tried both Id fields.
Here is the whole schema, which is rendering poorly in here:
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"d": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"results": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"__metadata": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"id": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
}
}
},
"uri": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
}
}
},
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
}
}
}
}
},
"Alerts": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"__deferred": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"uri": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
},
"Groups": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"__deferred": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"uri": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
},
"Id": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
}
}
},
"IsHiddenInUI": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
}
}
},
"LoginName": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
}
}
},
"Title": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
}
}
},
"PrincipalType": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
}
}
},
"Email": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
}
}
},
"IsEmailAuthenticationGuestUser": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
}
}
},
"IsShareByEmailGuestUser": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
}
}
},
"IsSiteAdmin": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
}
}
},
"UserId": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"__metadata": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
}
}
}
}
},
"NameId": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
}
}
},
"NameIdIssuer": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
},
"required": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
Based on this blog, https://knowhere365.space/microsoft-flow-create-a-new-sharepoint-group/ I added a variable and set it to: @{body('creategroup')['d']['Id']}
I added that variable to the send to http request step.
The error you get confirms that the Id value is empty:
Unable to process template language expressions in action 'Send_an_HTTP_request_to_SharePoint_Assign_Permission' inputs at line '0' and column '0': 'The template language expression 'body('creategroup')['d']['Id']' cannot be evaluated because property 'Id' doesn't exist, available properties are 'results'.
Maybe the expression should be
body('creategroup')?['d']?['results']?['Id']'
Could you try it or paste the output of the http action (the one which creates the group?).
Hope it helps!
Ferran
Hi @fchopo
I got a little further by watching this video at about the 7-minute mark. https://www.youtube.com/watch?v=kaxfnGdnzBo
The current sent http request looks like this:
From the video, the Method is POST. When I do that I get an error.
The property '__metadata' does not exist on type 'SP.Group'. Make sure to only use property names that are defined by the type.
When I use GET as the method, there is no error, but then it doesn't create the group.
A bit of an update @fchopo . I got the POST method to work. I'm going with the syntax is very picky.
As soon as I change the Title to a variable, the action times out with a "Bad Gateway" after retrying.
User | Count |
---|---|
93 | |
44 | |
21 | |
17 | |
16 |
User | Count |
---|---|
137 | |
50 | |
42 | |
39 | |
29 |