Skip to content

Add unbound Custom API Server Logic sample - #144

Merged
T-Nid (tyaginidhi) merged 8 commits into
microsoft:mainfrom
suyash1208:users/suyash/server-logic-unbound-custom-api
Aug 21, 2026
Merged

Add unbound Custom API Server Logic sample#144
T-Nid (tyaginidhi) merged 8 commits into
microsoft:mainfrom
suyash1208:users/suyash/server-logic-unbound-custom-api

Conversation

@suyash1208

@suyash1208 Suyash Kumar Patel (suyash1208) commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a ready-to-import unmanaged solution containing two unbound Dataverse Custom APIs, their parameters and response properties, the Server Logic component, and a signed plug-in assembly
  • include an enhanced-data-model Power Pages site named Custom API Support in Server Logic with no Code Site components
  • make the home page automatically invoke the unbound Custom Action (POST) and parameterized unbound Custom Function (GET with OData aliases), then render both results and reference code
  • include self-contained Header and Footer templates plus the homepage markup and JavaScript source
  • add visible security guidance for anonymous/authenticated endpoint access and minimum production privileges
  • ensure the full page remains vertically scrollable, render nested reference code legibly, and guard homepage initialization so only one Server Logic request is issued

Validation

  • local MasterPortal home page returned HTTP 200 and reached overall PASS
  • action returned HTTP 200 with ResponseNumber = 42
  • parameterized function received InputNumber = 61, returned HTTP 200 with ResponseNumber = 68, and preserved the encoded OData alias URL
  • browser trace contained exactly one request to /_api/serverlogics/sl-unbound-customapi-manual-test
  • the updated homepage rendered from the exact packaged source with the Security Note visible; axe-core WCAG A/AA/2.1 AA reported 0 violations, 24 passing checks, and 0 incomplete checks
  • public solution version: 1.0.0.2; SHA-256: 52B3C0100D132E767210008A72EF743B3CA7A101402975E8E541F4A748E4A6C6
  • Power Platform CLI unpacked and repacked the final ZIP; all 30 XML files parsed, source/package parity passed, and no target-environment or Code Site strings were present
  • the final package intentionally omits a primary domain, and an exact-package update preserved the activated site's existing address
  • the exact 1.0.0.2 package imported successfully with all 30 solution components intact; all 12 component/API assertions passed, including direct Action 42 and Function 68 results
  • the localized Home component explicitly clears legacy page CSS/JavaScript, preventing unmanaged updates from retaining an older second invocation script

Deployment note

After the first import, reactivate the included site, choose an available site address, and publish all customizations. The package does not carry a primary domain, so importing a newer version does not replace an activated site's address. When updating an existing test import, publish and clear the site configuration cache. Parameterized unbound Custom Functions through InvokeCustomApi are available starting with Power Pages runtime version 9.8.9.xx.

Homepage

Power Pages Custom API sample homepage

Suyash Kumar Patel and others added 6 commits August 18, 2026 00:21
Add a ready-to-import solution, source files, configuration screenshots, runtime evidence, and catalog entries for invoking unbound Dataverse actions and functions from Power Pages Server Logic.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update the importable solution, Server Logic source, documentation, and evidence to invoke the unbound Custom Function with OData parameter aliases.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update the root sample catalog to call out the parameterized unbound GET function.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Describe the updated screenshot as parameterized Custom Function evidence.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Package a self-contained traditional site whose home page runs both unbound Custom API examples and renders their results.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Ensure the page exposes vertical scrolling, renders reference code legibly, and initializes the Server Logic request once. Replace the portable solution with version 1.0.0.1.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tyaginidhi

Copy link
Copy Markdown
Contributor

Could you please verify the CSRF handling for the Server Logic request in samples/server-logic/unbound-custom-api/source/homepage.js?

The current implementation uses plain fetch with only an Accept header. Power Pages Server Logic requests may require an __RequestVerificationToken (or shell.safeAjax), so this could return HTTP 403 before get() executes. If the token is required here, please update the script and regenerate the solution ZIP containing it.

Remove Traditional site terminology, add the homepage security guidance, and publish the domain-safe 1.0.0.2 solution package.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Document that parameterized unbound Custom Function support through InvokeCustomApi is available starting with Power Pages runtime 9.8.9.xx.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tyaginidhi
T-Nid (tyaginidhi) self-requested a review August 20, 2026 16:03
@tyaginidhi
T-Nid (tyaginidhi) merged commit 30657b5 into microsoft:main Aug 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants