Share your feedback
+
+ This sample shows one thing: how to create a Dataverse record{' '}
+ from a Power Pages code site using the Web API (HTTP POST).
+
| [Fluent UI Bank Loan Application](samples/spa/react/fluent-ui-sample/) | React + Fluent UI | Build a form-driven portal using Fluent UI v9 controls, state management, and a dashboard-style data grid. |
|
| [Localization Sample](samples/spa/react/localization-sample/) | React + i18next | Add multilingual content, language switching, and localization patterns to a Power Pages code site. |
|
| [Authentication Sample](samples/spa/react/authentication-sample/) | React + Vite | Explore local sign-in, registration, password reset, invitation redemption, external sign-in, terms acceptance, and role-protected content. |
+|
| [Web API: Create a Record](samples/spa/react/web-api-create-record/) | React + Vite | Learn one focused task: create a Dataverse record from a code site with the Web API (POST), including the anti-forgery token and table permission. |
|
| [Vue Admin Template](samples/spa/vue/vue-admin-template/) | Vue + Vite | Start from a Vue 3 admin-style template that can be uploaded as a Power Pages code site. |
+| _(no preview)_ | [SharePoint Integration](samples/server-logic/sharepoint-integration/) | Server logic (JavaScript) | Call Microsoft Graph and SharePoint Online from server-side logic to upload files and create Dataverse records. |
## Sample categories
- [SPA Samples](samples/spa/) - code-site samples that use popular frontend frameworks and can be uploaded to Power Pages with the Power Platform CLI.
+- [Server Logic Samples](samples/server-logic/) - server-side logic samples that run business logic on the Power Pages server, including external service integrations.
## Resources
diff --git a/samples/server-logic/README.md b/samples/server-logic/README.md
new file mode 100644
index 00000000..7c1ee158
--- /dev/null
+++ b/samples/server-logic/README.md
@@ -0,0 +1,17 @@
+# Power Pages Server Logic Samples
+
+Server logic samples show how to run business logic on the Power Pages server -
+for example, calling external services, integrating with Microsoft Graph, or
+performing privileged operations that should not run in the browser.
+
+Use this index to choose the sample that best matches the scenario you want to
+explore.
+
+## Samples
+
+| Sample | Scenario | Highlights |
+| --- | --- | --- |
+| [SharePoint Integration](sharepoint-integration/) | Upload event tickets to SharePoint and record registrations | Microsoft Graph access token (client credentials), SharePoint file upload, Dataverse record creation, optional email via `Mail.Send`. |
+
+For setup details, prerequisites, and configuration, see the README in each
+sample folder.
diff --git a/samples/spa/README.md b/samples/spa/README.md
index 7c0a35d0..48129fa1 100644
--- a/samples/spa/README.md
+++ b/samples/spa/README.md
@@ -15,6 +15,7 @@ Use this index to choose the sample that best matches the framework or scenario
|
| [Fluent UI Bank Loan Application](react/fluent-ui-sample/) | React + Fluent UI | Loan application form and dashboard | Fluent UI v9 controls, form validation, tab navigation, and a data grid. |
|
| [Localization Sample](react/localization-sample/) | React + i18next | Multilingual blog site | Language switching, translated content, persistent locale selection, and i18next patterns. |
|
| [Authentication Sample](react/authentication-sample/) | React + Vite | Authentication flows | Local sign-in, registration, password reset, invitation redemption, external sign-in, terms acceptance, and protected profile content. |
+|
| [Web API: Create a Record](react/web-api-create-record/) | React + Vite | Create a Dataverse record | A single-purpose feedback form: anti-forgery token, Web API POST to `/_api/`, Web API site settings, and a Create table permission. |
|
| [Vue Admin Template](vue/vue-admin-template/) | Vue + Vite | Admin template | Vue 3 app structure, Vite build workflow, and Power Pages upload flow. |
## Common workflow
diff --git a/samples/spa/react/web-api-create-record/.gitignore b/samples/spa/react/web-api-create-record/.gitignore
new file mode 100644
index 00000000..a4d699a9
--- /dev/null
+++ b/samples/spa/react/web-api-create-record/.gitignore
@@ -0,0 +1,4 @@
+node_modules
+dist
+*.local
+.DS_Store
diff --git a/samples/spa/react/web-api-create-record/README.md b/samples/spa/react/web-api-create-record/README.md
new file mode 100644
index 00000000..45e2dc06
--- /dev/null
+++ b/samples/spa/react/web-api-create-record/README.md
@@ -0,0 +1,174 @@
+# Power Pages - SPA - Web API: Create a Record
+
+This sample demonstrates **one thing**: how to create a record in a Dataverse
+table from a Power Pages code site using the [Power Pages Web API](https://learn.microsoft.com/power-pages/configure/web-api-overview)
+(an HTTP `POST`).
+
+It is a small "Share your feedback" form. When the visitor submits, the app
+fetches an anti-forgery token and `POST`s a new row to a `Feedback` table.
+
+The entire concept lives in one file: [`src/api/webApi.ts`](src/api/webApi.ts).
+
+## Screenshot
+
+
+
+## What you will learn
+
+- How to fetch the **anti-forgery token** that Power Pages requires for every
+ unsafe (`POST`/`PATCH`/`DELETE`) Web API request.
+- How to **`POST` a new record** to `/_api/
+ This sample shows one thing: how to create a Dataverse record{' '}
+ from a Power Pages code site using the Web API (HTTP POST).
+