In the previous blog, the “what” and “why” of Server Logic were explored. This entry takes the concept further by demonstrating the implementation of a full CRUD (Create, Read, Update, Delete) interface that communicates with an external OData service.
The goal here is simple: move the “heavy lifting” to the server so your frontend stays clean and API calls stay secure.
Prerequisites:
Before beginning, ensure the following are available:
- An active Microsoft Dataverse
- A valid Power Pages license and access to a Power Pages site.
Getting Started
- Open Power Pages and select your desired environment and site.
- Navigate to Setup → Server logic (Preview).
Using the built-in Visual Studio Code editor, you can define your standard HTTP methods.
The beauty of this approach is that you don’t need separate scripts for every action; everything is handled within the get(), post(), put(), and del() functions.
Note: Server Logic assigned to a higher web role won’t be accessible to lower roles.
Authoring Server Logic
Below is a look at how the get() and del() methods appear inside the Server Logic file using the HttpClient object.. Read More