Tag Archives: Power Apps Portals
Implementing Smart Rules in Microsoft Power Pages Using Server Logic
In modern customer portals, simply collecting data is not enough, ensuring that the data follows real business rules is what truly makes a solution reliable. While many implementations rely heavily on client-side scripts for validation, these checks can be bypassed and often don’t reflect the actual logic enforced in CRM systems. When working with Microsoft Power Pages integrated with Microsoft Dynamics 365, implementing server-side smart rules allows organizations to enforce business policies securely and consistently. This approach ensures that validations happen where the data truly lives inside Dataverse making the portal not just user-friendly, but also trustworthy. This article walks through a practical CRM scenario to demonstrate how server logic can be used to enforce real business rules while maintaining a seamless user experience. The Real-World Scenario Imagine a customer support portal where users can raise support cases. From a business perspective, customers should only be able to create cases if they have an active support contract. Without server validation, a user could potentially bypass client-side checks and still submit a request. This creates operational issues, invalid records, and manual cleanup for support teams. To solve this, we implement a smart rule that checks contract status directly from Dataverse before allowing case creation. If the contract is inactive → The form is disabled and a message is shown If the contract is active → The user can submit the case Why Server Logic matters? Server-side validation ensures that rules are enforced regardless of how the request is submitted. Even if someone manipulates the browser or disables JavaScript, the rule still applies. This makes server logic the most reliable way to enforce entitlement checks, approval conditions, and compliance requirements. Key advantages include: How the Smart Rule works in this case? The logic is straightforward but powerful. Because the validation happens through a server query, the decision is authoritative and secure. What the User experiences? From the user’s perspective, the experience feels simple and intuitive. If their contract is inactive, they immediately see a clear message explaining why they cannot create a case. The form fields are disabled to prevent confusion. If their contract is active, they can proceed normally and submit their request without any additional steps. This balance between transparency and control creates a smooth user journey while still enforcing business rules. Server Logic vs Client Validation One of the most common questions is why server logic is necessary when client validation already exists. Client-side validation is excellent for improving usability by providing instant feedback, but it should never be the only layer of control because it can be bypassed. Server logic, on the other hand, acts as the final authority. It ensures that no invalid data enters the system, regardless of user actions. The best practice is to use both -> client validation for user experience and server logic for security. Steps to add Server Logic Step 1 – Identify the Business Rule First, clearly define what you want to validate. Example: Only allow case creation if the customer has an active support contract. This ensures you know what data needs to be checked in Dataverse. Step 2 – Create Required Table Permissions Server logic needs permission to read data from Dataverse. Go to Power Pages Management app Navigate to Security → Table Permissions Create a new permission Fill details: Save and repeat if needed for Case table. Step 3 – Create or Open Web Template This is where server logic (Liquid + FetchXML) lives. Go to Content → Web TemplatesClick NewName it:CaseCreationEligibilityCheck Paste your Liquid + FetchXML logic This template will run on the server when the page loads. Step 4 – Add FetchXML Query Inside the template, create a query to check eligibility. You’ll fetch records like: This query runs on the server and determines the outcome. When you will open the Server Logic code, you will see the default boilerplate server-side script that Power Pages generates for you when you create a new Server Script. What the boilerplate does Right now, it’s just a template; it doesn’t do any validation yet. How to adapt it for CaseCreationEligibilityCheck We want to: Here’s the code in this case:async function get() {try {// Get the current userconst contactId = Server.User.id;Server.Logger.Log(“Checking case creation eligibility for contact: ” + contactId); // Query Dataverse for active contractconst contracts = await Server.Connector.Dataverse.RetrieveRecord(“new_supportcontract”, // table namecontactId, // record id (for contact lookup, you may need a fetch query instead)“$select=new_name,statuscode”); let eligible = false;if (contracts && contracts.statuscode == 1) { // 1 = Activeeligible = true;} return JSON.stringify({status: “success”,eligibleToCreateCase: eligible,message: eligible? “You can create a new case.”: “You cannot create a new case. Active contract required.”}); } catch (err) {Server.Logger.Error(“Eligibility check failed: ” + err.message);return JSON.stringify({status: “error”,message: err.message});}} Step 5 – Add Conditional Logic Use Liquid conditions to enforce rules. If contract exists → Allow formElse → Show restriction message This ensures the UI responds based on real data. Step 6 – Attach Template to a Web Page Now connect the logic to a page. Go to Content → Web PagesOpen your Case pageSelect the Web Template you createdSave Step 7 – Test with Different Users Testing is important to validate behavior. User with active contract → Can create caseUser without contract → Sees restriction message This confirms your server rule works correctly. Step 8 – Improve User Experience Add clear messages so users understand what’s happening. Examples: Good UX reduces confusion and support calls. CRM Perspective From a CRM standpoint, this approach closely mirrors how real support entitlement works in enterprise environments. Support teams rely on accurate contract validation to prioritize requests and maintain service agreements. By enforcing these rules at the portal level, organizations ensure that only valid cases reach the support queue, reducing noise and improving response times. This also keeps portal behavior aligned with internal processes, creating a consistent experience across channels. Business Impact and Conclusion Implementing smart server rules in Microsoft Power Pages is more than a technical exercise. It’s a way to streamline operations, maintain data integrity, and … Continue reading Implementing Smart Rules in Microsoft Power Pages Using Server Logic
Advanced Field Control in Power Pages Using JavaScript and Liquid – Real Scenarios from Projects
While working on Dynamics 365 Power Pages implementations, I realized very quickly that portal metadata alone cannot handle complex business requirements. Basic field visibility rules are easy, but real-world forms demand dynamic behavior that depends on user role, record data, multi-select options, and business logic. This is where combining JavaScript (client-side control) with Liquid (server-side logic) becomes powerful. This article shares practical scenarios where this approach made the solution possible. Why Configuration Alone Was Not Enough Portal Management allows: But in my projects, requirements looked like this: These are not achievable with metadata alone. Role of JavaScript vs Liquid (How I Use Them) Purpose Tool Why Dynamic field behavior JavaScript Runs instantly in browser User role detection Liquid Server knows portal roles Record-based decisions Liquid Data available before render UI interactivity JavaScript Responds to user actions Liquid decides what context the page loads with.JavaScript controls what happens after the page loads. Scenario 1: Multi-Select Option Controls Multiple Fields Requirement:If a user selects “Service Issue” AND “Billing Issue” in a multi-select, show an escalation section. Problem: Metadata rules cannot evaluate multiple selections together. My Approach: This improved user experience and prevented unnecessary data entry. Scenario 2: Role-Based Form Behavior Requirement: Managers should see approval fields; normal users should not even know those fields exist. Why Liquid Helped:Portal roles are determined server-side, so I used Liquid to pass a flag to JavaScript. Then JavaScript handled visibility accordingly. This ensured: Scenario 3: Locking Fields After Status Change Requirement: Once a case moves to “Submitted”, users should only view, not edit. Solution Design: This approach avoided creating multiple forms and kept maintenance simple. Scenario 4: Dynamic Label Changes Requirement: Label should say: Instead of duplicating forms, JavaScript updated the label text based on user type passed via Liquid. Preventing the Common Mistake JavaScript improves UX, but it does not secure data. I always ensure final validation also exists in: Portal scripting is the first layer, not the only layer. Lessons Learned from Real Implementations To encapsulate, Power Pages becomes truly flexible when JavaScript and Liquid are used together with clear responsibility boundaries. Liquid prepares the context; JavaScript handles the interaction. In my experience, this combination bridges the gap between standard configuration and complex business needs without overcomplicating the architecture. Custom portal behavior is not about more code but it’s about placing logic at the right layer. If you found this useful and are working on similar Power Pages scenarios, feel free to connect or reach out to the CloudFronts team – transform@cloudfronts.com, for deeper discussions on advanced Dynamics 365 implementations.
FetchXML Made Simple: Power Pages Tips for Dynamic Data Retrieval
Dynamics 365 Power Apps Portals (formerly Dynamics 365 Portals) allow organizations to securely expose CRM data to external users. However, fetching and displaying CRM records in a portal page requires more than just entity lists – it often needs custom data queries. That’s where FetchXML comes in. FetchXML is Dynamics 365’s native XML-based query language used to retrieve data and it’s fully supported in Liquid templates within portals. Step 1: Pre-Outline Brief Target Audience: How this blog helps: Step 2: Blog Outline Opening:Identify the need for FetchXML in Power Pages and its importance for developers and portal managers. Core Content: Step 3: Blog Post Introduction For businesses leveraging Microsoft Power Pages, the ability to pull dynamic data from Dataverse is critical. While out-of-the-box entity lists work for simple scenarios, complex needs — such as personalized dashboards and filtered data — require custom FetchXML queries embedded in Liquid templates. In this post, we’ll walk you through how FetchXML works in Power Pages, share examples, and provide best practices so you can deliver efficient, personalized portals. Why This Matters For growing businesses, service portals need more than just static lists. As the volume of data increases, the ability to dynamically query and display relevant information becomes essential to maintain performance, improve user experience, and reduce maintenance efforts. With FetchXML in Liquid, developers can: Prerequisites Before getting started, ensure: Understanding FetchXML FetchXML is an XML-based query language for Dataverse. It allows you to: Example: Retrieve all active contacts: Using FetchXML in Power Pages (Liquid Templates) Here’s a basic implementation: This will execute the query and display results dynamically in your portal. Making FetchXML Dynamic You can make FetchXML personalized by using Liquid variables. Example: Display cases only for the logged-in user: Real-World Example: Recent Cases Dashboard] Best Practices To conclude,FetchXML in Power Pages is a powerful tool for creating customized, dynamic, and efficient portals. Start small — add a dynamic list or dashboard to your portal today. If you need expert guidance, CloudFronts can help you implement FetchXML-driven solutions tailored to your business needs. 💡 Want to learn more? Reach out to CloudFronts Technologies at transform@cloudfronts.com to explore FetchXML use cases for your portals and improve your customer experience.
Making the Right Choice: Session Storage or Local Storage in Power Pages
Step 1: Pre-Outline Brief Target Audience: Purpose:To clarify when to use session storage vs local storage in Power Apps Portals, using a real-world use case: syncing customer dropdown selection across pages in a portal. Pain Points Solved: Step 2: Core Content Scenario Overview I was working on a customer dropdown inside a Power Apps Portal (Dashboard). When a customer was selected, I wanted: This brought up the key question: “Should I use session storage or local storage?“ Understanding Session Storage vs Local Storage Before diving into the solution, let’s break down the difference: 🔹 Session Storage 🔹 Local Storage Key difference: Problem Statement When building multi-page Power Apps Portals, we often need to carry user selections (like Account/Customer IDs) across pages. But which one should we use? Initial Approach and Issue I first used localStorage for the customer selection. While it worked across pages, it had one drawback: This confused users because they expected a “fresh start” after logging back in. Working Solution: Using Session Storage The best solution was to use sessionStorage: Power Apps Portal Code Example 1. Store customer selection in sessionStorage (Dashboard page): 2. Apply selection on another page (e.g., Contracts page): 3. Clear selection on Sign Out (SignIn page): Benefits of This Approach In Power Apps Portals, deciding between sessionStorage and localStorage depends on user expectations: In my customer dropdown scenario, sessionStorage was the clear winner, as it ensured selections synced across pages but reset cleanly at logout. Sometimes, it’s not about picking one — but knowing when to use both to balance persistence with user experience. Need help implementing storage logic in your Power Pages? Reach out to CloudFronts Technologies as I’ve already implemented this use case for syncing dropdowns between Dashboard and childpages in a Portal website. You can contact us directly at transform@cloudfronts.com.
Unlock the Power of Power Pages: Building Websites with Dynamics 365
Power Pages, which was earlier known as Power Apps Portals, a powerful low-code platform from Microsoft, allows you to create websites seamlessly integrated with Dynamics 365. Whether you’re building a customer portal, a partner collaboration site, or an internal application, Power Pages makes it easy to deliver rich web experiences. Here’s a beginner-friendly guide to help you create your first Power Pages site. What is the difference between Normal Websites and Websites Created by Power Pages? Getting Started with Power Pages: Sign in to Power Pages:To get started, sign in to the Power Pages platform using your Microsoft account. If you don’t have one, create a new account. Once signed in, you’ll be taken to the Power Pages home screen where you can begin creating your site. Create a New Site:You can start by creating a site from scratch. Choose the “Start from blank” option or use one of the available templates to speed up your development process. Templates are pre-built designs that you can customize to fit your needs. Choose a Site Name and Web Address:Select a site name that reflects the purpose of the site (e.g., “Customer Portal” or “Partner Collaboration Site”). Choose an appropriate web address (URL) that aligns with your business branding. Power Pages will guide you through the process of selecting a domain name and integrating it with your site. Configure Site Settings:Once your site is created, you’ll be able to configure various settings such as branding, theme, and layout. Power Pages provides an intuitive interface where you can adjust these settings with minimal effort. Click to edit the Power Pages using the Studio. Design and Edit Your Site:Click to open and edit your site using Power Pages Studio. This drag-and-drop interface makes it easy to add content such as text, images, forms, and data from your Dynamics 365 system. The Studio allows you to customize the site’s design, layout, and interactive elements to create a rich user experience. Let’s add a section and select the column as per your wish. Select ‘List’ Select the table and the list of records you want to see in your Webpage This appears after adding the List. There is a notification to set up permissions on the list. Click on + New permission. Let’s Add roles and click Save. Now click Sync followed by Preview. Sync feature is to make sure that the changes made in the Power Pages Studio are reflected across the platform whereas Preview feature allows you to see a live, interactive version of your website before publishing it. This gives you the opportunity to review and test how the site will look and function for end users. Also, there is another way of editing and designing Power Pages. Why do we need Power Pages Management? While Power Pages Studio is designed for creating and designing websites, focusing on content, layout, and interactivity, the Power Pages Management App provides a separate interface for managing the operational, security, and administrative aspects of the site. Key Functions of Power Pages Management: The separation of responsibilities between the design and management aspects ensures that both designers and administrators can focus on their respective tasks without compromising the site’s functionality, security, or scalability. This division enhances the overall efficiency and flexibility of managing a Power Pages website. Happy Developing! We hope you found this blog useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfonts.com
Setting Up Authentication and Security in Power Pages
Power Apps Pages, part of the Microsoft Power Platform, allows you to create responsive web applications that can be accessed by both internal and external users. Setting up authentication and security is crucial to ensure that only authorized users can access your application and its data. In this blog, we’ll walk you through the steps to set up authentication and security in Power Apps Pages. In this blog, we’ll cover the essentials of setting up security in Power Pages. Step 1: Configure Authentication Click on Power Pages sites and then select your portal. There is another way of authenticating your Power Pages Set Up Identity Providers using Azure For Azure AD: Enable Authentication Step 2: Setting Up Security Start by navigating to Power Pages Studio. Choose the site where you want to set up authentication. Click the ellipses (three dots) next to the Preview button and select ‘Power Pages Management’ in Power Pages Studio. This will take you to the Power Pages Management interface where you can make various administrative changes. Select the ellipses and click Web Roles Click on New to create a new web role. Name the role , in this case, (‘FreeSpirit Global Admin’) and save it. Web Page Access Control Rule in Power Pages is a security feature that defines which users or roles can access specific web pages on a site. This rule ensures that only authorized users can view or interact with restricted content, protecting sensitive data and maintaining site security. Add Web Roles to the Web Page Access Control Rule Step 3: Configure Page Security Navigating Page Settings in Power Pages Studio Go to Power Pages Studio -> Select the ellipses and Page Settings -> Go to Permissions and add the Role of the viewer Securing Power Pages using Power Pages Management Assigning Web Roles to Contact. Make sure the Form is set to Portal Contact. Select Web Roles from the Related drop-down Add Existing Web Role or create a new one if you want Table Permissions using Power Pages Management Navigate to Security > Table Permissions. Click on New to create a new table permission. Specify the table (entity) and the permission type (Read, Write, etc.). Assign the permission to a web role. Secure Individual Pages In the Portals Management App, navigate to Web Pages. Select the page you want to secure. Under the Permissions tab, add the web role that should have access to this page. Step 4: Additional Security Settings Set Up Multi-Factor Authentication (MFA) For added security, configure MFA in your Azure AD. Go to the Azure AD portal. Navigate to Security > Multi-Factor Authentication and follow the setup instructions. Configure IP Restrictions You can restrict access to your Power Apps Pages based on IP addresses. In the Portals Admin Center, navigate to Site Settings. Add new site settings for IP restrictions and specify the allowed IP addresses. Review and Monitor Security Logs Regularly review security logs for any suspicious activity. In the Azure AD portal, navigate to Monitoring > Sign-ins to review sign-in activity. Conclusion Setting up authentication and security in Power Apps Pages ensures that your application and its data are protected from unauthorized access. By configuring identity providers, creating security roles, setting up appropriate permissions, and implementing additional security measures like MFA and IP restrictions, you can manage who accesses your portal and what they can do within it. Follow these steps to create a secure and robust Power Apps Page for your users. By following this guide, you can ensure your Power Apps Pages are secure and provide a seamless experience for your users. Happy Building! We hope you found this blog useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfonts.com.
Seamlessly Redirecting Users to Subpages in Power Pages: A Complete Guide
When developing web applications, one of the most common features you might need is the ability to dynamically redirect users to different subpages based on certain conditions, such as whether they are logged in or not. This ensures a smooth and personalized experience for users navigating your portal. In this guide, we’ll walk through how to set up redirection in Power Pages based on user authentication. Whether you’re building a public-facing portal or a member-only dashboard, this solution will help you ensure that users land on the right page based on their status. In our example, we want to redirect users based on their authentication status: By default, when users access your Power Pages portal, they land on the homepage. In this case, you want to check if the user is logged in and redirect them accordingly. We’ll use a Web Template in Power Pages. This template will contain the necessary JavaScript to check if the user is logged in and redirect them based on that. P.S. These below lines are included from the Default Studio Template. Don’t forget to include in your code. Next, create a Page Template and add the newly created Web Template. Go to Web Pages and update the Page Template as well. Click Save. And voila! The default landing page appears as soon as I access the website. With this simple solution, you can enhance the user experience by ensuring that visitors to your Power Pages portal are always directed to the content that’s most relevant to them. Happy Building! We hope you found this blog useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfonts.com
