Get Page by Title
How to get a page by filtering on the title in a SharePoint Online site using the Graph API in a Power Automate flow.
URI
_api/v2.0/sites/@{variables('SiteId')}/pages?$filter=title eq '@{variables('PageTitle')}' |
Headers
{ | |
"Accept": "application/json;odata=verbose", | |
"Content-Type": "application/json;odata=verbose" | |
} |
Body
Not applicable
Screenshot with example
Sample data
SiteId – contoso.sharepoint.com,0b11c57d-ef88-46d7-9743-8e800c507595,af1a15c6-956b-4652-b8f8-869836e4e6ee
PageTitle – Page with Text Web Part
Copy/paste example
{"id":"18f32939-7296-4654-b5e4-357cf97934e7","brandColor":"#036C70","connectionReferences":{"shared_sharepointonline":{"connection":{"id":"/exp_sharedsharepointonline_e5efa"}}},"connectorDisplayName":"SharePoint","icon":"https://connectoricons-prod.azureedge.net/releases/v1.0.1664/1.0.1664.3477/sharepointonline/icon.png","isTrigger":false,"operationName":"Send_an_HTTP_request_to_SharePoint","operationDefinition":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_sharepointonline","operationId":"HttpRequest","apiId":"/providers/Microsoft.PowerApps/apis/shared_sharepointonline"},"parameters":{"dataset":"@parameters('SPOSiteCollection_PowerUsers (exp_SPOSiteCollection_PowerUsers)')","parameters/method":"GET","parameters/uri":"_api/v2.0/sites/@{variables('SiteId')}/pages?$filter=title eq '@{variables('PageTitle')}'","parameters/headers":{"Accept":"application/json;odata=verbose","Content-Type":"application/json;odata=verbose"}},"authentication":{"type":"Raw","value":"@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$ConnectionKey']"}},"runAfter":{"Initialize_variable_-_PageName":["Succeeded"]},"description":"?$filter=name eq '@{variables('PageName')}'&$select=Id","metadata":{"operationMetadataId":"63f05857-8468-4398-9e04-5d4c9b6e7ace"}}} |
Resources
That’s it, Happy testing!