Skip to content

Instantly share code, notes, and snippets.

@expiscornovus
Created January 23, 2026 13:48
Show Gist options
  • Select an option

  • Save expiscornovus/b7a150b54666d7e79f0058ce81f3e29f to your computer and use it in GitHub Desktop.

Select an option

Save expiscornovus/b7a150b54666d7e79f0058ce81f3e29f to your computer and use it in GitHub Desktop.
Add Button Web Part on Page
{"id":"443f3f6e-4fdd-4346-87f4-d029de6408ca","brandColor":"#474747","connectionReferences":{"shared_sharepointonline_1":{"connection":{"id":"/exp_sharedsharepointonline_1c1d3"}}},"connectorDisplayName":"SharePoint","icon":"https://conn-afd-prod-endpoint-bmc9bqahasf3grgk.b01.azurefd.net/v1.0.1769/1.0.1769.4352/sharepointonline/icon.png","isTrigger":false,"operationName":"Send_an_HTTP_request_to_SharePoint","operationDefinition":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_sharepointonline_1","operationId":"HttpRequest","apiId":"/providers/Microsoft.PowerApps/apis/shared_sharepointonline"},"parameters":{"dataset":"@parameters('SPOSiteCollection_PowerUsers (exp_SPOSiteCollection_PowerUsers)')","parameters/method":"PATCH","parameters/uri":"_api/v2.0/sites('@{variables('SiteId')}')/pages/@{variables('SitePageId')}/oneDrive.page","parameters/headers":{"Accept":"application/json;odata=verbose","Content-Type":"application/json;odata=verbose"},"parameters/body":"{\n \"@odata.type\": \"#microsoft.graph.sitePage\",\n \"title\": \"Add Button Web Part on Page\",\n \"canvasLayout\": {\n \"horizontalSections\": [\n {\n \"layout\": \"oneColumn\",\n \"id\": \"1\",\n \"emphasis\": \"none\",\n \"columns\": [\n {\n \"id\": \"1\",\n \"webparts\": [\n {\n \"id\": \"@{guid()}\",\n \"webPartType\": \"0f087d7f-520e-42b7-89c0-496aaf979d58\",\n \"data\": {\n \"dataVersion\": \"1.1\",\n \"description\": \"Add a clickable button with a custom label and link.\",\n \"title\": \"Button\",\n \"properties\": {\n \"alignment\": \"Right\",\n \"minimumLayoutWidth\": 9,\n \"openInNewTab\": true\n },\n \"serverProcessedContent\": {\n \"htmlStrings\": [],\n \"searchablePlainTexts\": [\n {\n \"key\": \"label\",\n \"value\": \"Visit my website!\"\n }\n ],\n \"links\": [\n {\n \"key\": \"linkUrl\",\n \"value\": \"https://www.expiscornovus.com\"\n }\n ],\n \"imageSources\": []\n }\n }\n }\n ]\n }\n ]\n }\n]\n}\n}"},"authentication":{"type":"Raw","value":"@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$ConnectionKey']"}},"runAfter":{"Initialize_variable_-_SitePageId":["Succeeded"]},"metadata":{"operationMetadataId":"e006a3a0-8d74-4c66-867c-8c3b7fa1b3c9"}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment