Power Pages – Liquid vs. JavaScript

Microsoft Power Pages is a secure,  enterprise-grade platform for creating, hosting, and managing modern business websites with little to no code. It is part of the Microsoft Power Platform family, which also includes Power Apps, Power Automate, Power BI, and Power Virtual Agents.

Liquid vs. JavaScript

When you’re working with power pages it doesn’t take long to find the limits of the built-in functionality. While there are many out of the box options to solve the problems you encounter there are certainly gaps that can be frustrating. A couple of ways these gaps can be overcome is by using Liquid and JavaScript to write custom code. Between these two languages users can really start to fine tune their Portals. We’re going to take a look at when you should use one over the other.

When to use JavaScript

If you have experience customizing Dynamics, you likely have some experience with business rules. These allow users to perform logic and update forms dynamically. One of the bigger gaps in Power Pages is that business rules don’t work on forms when loaded there. Even if they function just fine in Dynamics. So, anything that would use business rules for Dynamics needs to be done with JavaScript in Power Pages. This includes actions such as showing/hiding column, locking/unlocking columns, setting column values, and displaying error messages. While it’s a bummer we can’t use business rules, using JavaScript directly allows us to do all of that and more. The additional features we have with JavaScript include the ability to do data validation and use more complex logic to set values.

When to use Liquid

On the surface it might not be as easy to find uses for liquid code. One of the main benefits is that it allows you to add or swap out different components on your webpage. Say there are two different account forms, and you want to swap them out based on the account type. We can easily do that with Liquid. We can also add buttons to pages that require more logic than you could otherwise do with the built-in features. Another use case is to insert content snippets to a site which allows users to really organize their web templates. While these are just a couple examples, the options are quite large. Overall, if you want to do anything beyond the scope of the Dataverse form liquid will be your best bet. Microsoft also has a lot of great info on it to help you along the way.

Microsoft’s Liquid Overview:

Interested in more information about the capabilities of Microsoft Power Platform? See our service page for details.

Contact Beringer Today!

We love to implement Microsoft Dynamics 365 and Power Platform solutions here at Beringer.  We’ve been working with Microsoft Dynamics since its inception, and we’re always finding innovative ways to implement the latest tools and help automate business processes.

Beringer Technology Group, a leading Microsoft Gold Certified Partner specializing in Microsoft Dynamics 365 and CRM for Distribution also provides expert Managed IT ServicesBackup and Disaster RecoveryCloud Based Computing, Email Security Implementation and TrainingUnified Communication Solutions, and Cybersecurity Risk Assessment.