How to fix Web API requests with FetchXml being blocked by Power Pages Web Application Firewal
After enabling the Web Application Firewall in a development Power Pages site, some developers reported that some web API queries using FetchXML stopped working, throwing a 403 error. After running some tests to validate the issue, it turned out that WAF was detecting them as an attack. This blog post details how the query was written and what we need to do to fix it. Troubleshooting The first step was to identify what queries were...
Get a Power Pages site URL dynamically per environment to send emails via Power Automate
When we deploy Power Automate flows that send emails with URLs in the body across environments, it’s never a good practice to have those URLs hardcoded in the body. For the cases where those URLs target a Power Pages site, there are some ways we can make them dynamic per environment, you can think of environment variables but there is an even simpler way. I know this can look simple but the other day there was someone asking me...
Using Power Pages Web Application firewall to Rate limit Web API calls
In some scenarios where you have a custom Power Pages website that leverages the web API for specific pieces of functionality, you might want to add some rate limiting to it so users cannot overuse the API (for example by creating a script to abuse it and running it using chrome developer tools). Enable Web Application Firewall To enable WAF for your site you need to have CDN enabled. See steps below for more details: Content Delivery...
Power Pages CSP: Starter Settings
While working on CSP (Content Security Policy) settings on Power Pages to make the site external connections or loading of external references more restrictive, we can find a few challenges if we restrict all to ‘self’, we will break a lot of out-of-the-box functionality as some fonts, scripts and content are by default hosted outside of the website domain (they are on PowerApps, Office, SharePoint and Microsoft...
Dataverse Image fields not copiyng in full resolution using the XRMToolBox DataTransporter? Power Automate to the rescue!
When moving data from a custom Table I created to store Rich Text Images into another environment using the XRMToolbox data transporter, I noted the images looked blurry: Checking the image size, it’s only a small image (like a few KB) when the original image had more than 200kb in size. So I wondered, what went wrong in the copy. It turns out the Image field is a reference to a ‘FileAttachment’ table item on the background, and we...
Power Pages: Use a custom Rich Text Files table to store images (and avoid exposing the full msdyn_richtextfiles table)
In my previous post, I explained how to display images from a Dataverse Rich Text field in Power Pages using Liquid. However, this method enables read access to all records in the Rich Text Attachments (msdyn_richtextfiles) table, which might not be ideal in case the Dataverse environment has other functionalities that have private information stored in that table and should not be available in a Power Pages site. However, we can...
Power Pages: Display images from a Rich Text field using Liquid
Dataverse Rich Text fields store the content as HTML text in the field itself but the images that are uploaded are stored as attachments in the Rich Text Attachments table (msdyn_richtextfile). Those files are referenced directly with the URL to get the preview as image from the WebAPI, when we open them from a Model Driven app they work fine since we have access to the Dataverse Web API. But when we try to render those images that...
Hiding the ‘Forms’ button in a SharePoint list view using List Formatting
I got the following request from a community member: Hi, I want to hide forms from the command bar. Please advise We can achieve this by using SharePoint list formatting Code to use You can use the following JSON Formatting snippet to hide the Forms button in a SharePoint list (bear in mind all the views need to have the formatting applied if you want to always hide it). { “$schema”:...
Power Pages, FetchXML and Liquid: Group results by Lookup fields
When we run FetchXML queries on Power Pages Liquid code we get the results as a single table data structure. But sometimes it would be useful if we could group the results by some of the fields on the data set before rendering the items on the page, so we can use that for some calculations or to render data in a structure that is not a table structure or flat data structure display, like a hierarchy view for instance. We can do it...
How to create Azure DevOps pull requests using Power Automate
Recently I needed to automate the creation of Pull requests using Power Automate, but noted that there is no out-of-the-box action for that. But as usual, I love to dig into the Rest API capabilities of each platform and I figured out how to do it using the “Send an HTTP Request to Azure DevOps” action. Check out how to do it in this post. Creating the request To create the Pull request we...
Power Pages Table Permissions: Configure permissions to see records from child Accounts
Table permissions is a feature that allows you to control who can view, edit, or delete Dataverse records from a Power Pages site. Power Pages allows to easily configure table permissions based on Contact or Account relationships directly, for example, a user can see all records where they are the Contact in the field configured in the table permission, or their Account is their account in the field configured. However,...
Copy Dataverse contact phone numbers across different environments based on Contact e-mail address using Power Automate
Sometimes we can easily use manually triggered Power Automate Flows as ‘mini-scripts’, to run actions in bulk, such as creating/modifying data. I recently came across the need to sync a field (Business Phone) for contacts with the same email address from different environments, as in the destination environment this field was not previously used/provided, in a situation where we have two separate Power Pages portals and we have...
Get the current logged Power Pages user Contact ID via JavaScript and use it to create records assigned to the current user
If you are working with Power Pages Pro Code Development, you might need to access the current logged user Contact ID for various purposes, such as personalizing the content, saving data using the WebAPI and relating to the current user. In this blog post, I will show you how to do it via JavaScript in two different ways. Liquid to help To get the current logged user Contact ID via liquid we can to use the Liquid syntax {{user.id}}....
How to get the current Azure Devops iteration name for a project using Power Automate
I was doing some investigation on how I could automate some standard messages we send for my team related to some sprint tasks using Power Automate, and one simple requirement was to automatically detect the current sprint (iteration) name, to make an email content dynamic. The problemThere is one action in Power Automate to get iterations, but it does not have a filtering option. We could leverage this one in combination with the...
How to create Microsoft Teams private channels using Power Automate and the ‘Send a Microsoft Graph HTTP request’ action
Using the standard Power Automate actions for Microsoft Teams we can only create a standard channel, but by using Microsoft Graph with the new ‘Send a Microsoft Graph HTTP request’ action it’s possible to extend the standard actions similarly to my previous post, and create private channels in Microsoft Teams. Microsoft Graph request format To create a Microsoft Teams channel via Graph, you need to send a request body...
Using the new ‘Send a Microsoft Graph HTTP request’ action in Power Automate to send urgent messages in Microsoft Teams
One limitation we have in Power Automate’s standard Microsoft Teams actions is the inability to send high messages flagged as URGENT on Teams. However, with the new ‘Send a Microsoft Graph HTTP request’ action, we can overcome this issue and send messages flagged as urgent in Microsoft teams, enhancing our communication automation capabilities within Teams and Power Automate. The Microsoft Graph Request needed & Action in...
Power Pages and Cloud Flows – Validate user against Dataverse records based on Contact ID
When we use the Cloud Flows integration in Power Pages, we can use Web Roles to restrict what users can call the Flow or not. But sometimes only this is not enough and we might want to add more logic in the Flow to prevent certain actions. For instance, you can validate the Contact ID against Dataverse records to ensure the user has the right to execute certain actions. Check out how you can do it. Contact ID in the Trigger Every...
Download SharePoint library files in Power Pages with JavaScript and Cloud flows – Improved code using jQuery & option to open PDF file in a new tab
Last week I demoed an improved solution of my previous blog post: Using JavaScript and Cloud Flows to download files from a SharePoint document library in Power Pages in the Microsoft 365 & Power Platform community (PnP) call. The Cloud flows are the same as on the previous post, but on the JavaScript side there were a few updates: Using jQuery instead of Vanilla JsAdded more comments to the codeAdded option to preview PDF files...
Handle multiple N:N records associate and disassociate requests with JavaScript and Power Pages Web API
In my previous posts Creating and removing N:N relationship between Dataverse records using Javascript and Power Pages Web API I showed how we can leverage the Power Pages Web API to handle single N:N associate and disassociate requests for a custom N:N relationship between Accounts and Contacts, and also in the following post Generic JavaScript Functions to Associate and Disassociate Dataverse records using the Power Pages Web API, I...
Generic JavaScript Functions to Associate and Disassociate Dataverse records using the Power Pages Web API
In my previous post Creating and removing N:N relationship between Dataverse records using Javascript and Power Pages Web API I showed how we can leverage the Power Pages Web API to handle single N:N associate and disassociate requests for a custom N:N relationship between Accounts and Contacts. In case we want to extend that to be more generic to any N:N relationship we can leverage a custom function that can be used in multiple...
Creating and removing N:N relationship between Dataverse records using JavaScript and Power Pages Web API
Managing Dataverse N:N relationships between records using the Power Pages Web API can be trickier as there are few samples around and the syntax differs a little bit from handling N:N relationships using the Dataverse Web API. In this post I will show a quick code sample on how you can handle that, using a sample N:N custom relationship between Contacts and Accounts. Prerequisites All required fields (including the N:N relationship...
Trigger a Cloud Flow when CSS webs file are modified in Power Pages (Standard Data Model)
Sometimes when multiple developers work on the same Power Pages site using Power Platform CLI or changing WebFiles/WebTemplates via browser we might have update conflicts. One special case is when we have custom styles developed using SCSS and not pure CSS. We can have more than I developer working on separate partials and using Fiddler to test updates locally, but for the updates to take effect in the Power Pages site for other...
Setting a SharePoint Date only field value to the current date using List Formatting JSON
This post is based on a recent question that I got from a blog reader in a blog post related to List Formatting and setting field values: I am trying to add an action button to my Microsoft list. The reason for this is that I would like the trip date column to populate with the current date the button was pressed. Just to make it easier for the executives to confirm they have completed a work trip. Can this be done thru list and...
Using JavaScript and Cloud Flows to download files from a SharePoint document library in Power Pages
Even though we can now use Virtual Tables to expose SharePoint lists in a Power Pages site, the same does not apply to SharePoint Document libraries. You can use the native SharePoint integration to display content that was set up in that way from the Model Driven Apps side, but you cannot expose a custom library in that way. For example, if you want to expose a random library with Document templates for users to download, there is no...
Converting a certificate from .cert to .pfx to use with Power Pages OAuth2 implicit flow
We know that in order to use OAuth2 implicit flow in Power Pages, we need to have a certificate in the proper format as specified by Microsoft here: Manage custom certificates As we can the Let’s Encrypt service to generate free SSL certificates, I was wondering if I could not use the same developing Power Pages integration POCs in my developer tenant. Those certificates actually meet the criteria but they are not immediately in...
Ignite 2023: Curated blog posts with Microsoft 365 & Power Platform Updates
Microsoft Ignite 2023 was a remarkable event that showcased many exciting announcements across the Microsoft cloud platform in the era of AI. At Ignite 2023, Microsoft focused on AI and its impact on industries. Most of the highlights involve the new features and capabilities of Microsoft Cloud stack involving Artificial Intelligence and Copilots, which aim to enhance productivity and bring new ways of work. Image generated by...
Getting the proper SharePoint list columns internal names to use in List Formatting JSON
Question sent by a reader recently, on my Quick SharePoint Approvals using list formatting JSON to set field values formatting post: Will this not work if my column name has a number in it? I have to submit documents for 2 reviews, and I am using “1st Reviewer Status” and “2nd Reviewer Status” as the column names, but the above code will not populate the approved/rejected in that column. I modified the columns to “Reviewer One Status”...
Create parent and child records with a single WebAPI call in Power Pages
If you want to create a record with its child records in Power Pages, there is no way to do it using out of the box forms. But you can do it using JavaScript Power Pages Web API, and with a single Web API call. In this blog post we will use the example of creating an Account with 2 child Contacts in Power Pages. Prerequisites Enable both the Account and Contact tables for the WebAPIEnable the fields used in the WebAPI call for both...
How to allow users to only Add and View SharePoint list items (block editing/deleting)
This blog post is based on a recent question that I got from a blog reader in a blog post related to List Formatting: Is there a way to disable the edit capabilities when users click on the “View” button? I want users to be able to view their entries after they create the item, but not edit it. You cannot disable the capabilities directly with List Formatting or via list settings only. But you can do this by creating a...
Power Pages WebAPI error with N:N relationship enabled table permissions
Recently working on a more complex table permissions scenario on Power Pages, where we required a N:N relationship relationships with more levels of child permissions, we had nice results when using out-of-the-box lists and also with Liquid custom Web Templates. However, I noted a few errors with basic GET queries in the WebAPI such as: {“error”:{“code”:”9004010D”,”message”:”Common...
Call authenticated external APIs using JavaScript from Power Pages
If you need to call external APIs using JavaScript from Power Pages, you may want to secure the calls to avoid exposing information or application hacking, as all the calls are made from client side. Power Pages sites can have OAuth 2.0 implicit grant flow enabled, so you can obtain an authentication token that has your Portal as the issuer, and you can use this token to do authenticated calls to external APIs. This post is a quick...
Using SharePoint list formatting and Power Automate to create linked items (via LookUp field) in a related list
Recently I was asked by a community member how to create a linked issue item (via LookUp field) using SharePoint list formatting. Via pure list formatting, it’s not possible to implement such functionality. But we can use List Formatting to create a button that triggers a Power Automate flow and this flow creates a linked issue as below: Check out how to implement this functionality in this post. Create an Issues list Create a...
Using the HTTP with Azure AD connector in Power Automate to create Planner Plans and add them as Teams tabs
Some people have reported to me that the beloved Send an HTTP request (V1) under Office 365 groups that we used to easily call Microsoft Graph is not available anymore when creating new flows. It turns out it has recently been deprecated, as stated by Microsoft, and we are recommended to use V2 instead: Unfortunately, the V2 action only supports the /groups endpoint and will not allow us to create planner plans. The alternative At the...
Create an Issue Tracker App using Power Apps Copilot (Preview)
Recently I tried out the Power Apps Copilot, which is still in Preview but even though not yet perfect, had actually quite interesting results. I used it to create a basic Issue Tracker app. Here are my first impressions on this post. How can I use Copilot? Currently Copilot is available only for Power Platform environments hosted in the United States. You can try it out even with a Developer environment. Just make sure that when you...
Issue solved: Canvas Apps PDF function – ‘PDF Creation Failed’ when using a gallery and checking conditions before calling the PDF function
Recently a reader reported an issue happening while using the PDF export functionality in Canvas Apps: I have an application with 2 galleries. The first one is populated with items that are users from a group, and the other is a collection that is populated with users from first table. Items with users from first gallery are “moved” to a collection and then, displayed to the secondary gallery. Like in your example, I put a button that...
Filtering Dataverse data by the current user in Cards for Power Apps
While playing around cards for Power Apps, I noted that the User Power Fx function that is used in Canvas Apps to detect the current user and get some information about it is not supported. After some investigation, I found that Cards use a new object called Viewer instead. How to use the Viewer Object The viewer object has 3 properties that potentially we could use to filter data by the Current User : name: it’s the user...
Sort an object array by numeric values that are stored as string using Power Automate
Recently I got a question in a previous post about the sort expression in Power Automate: I am attempting to use this expression in a compose box to sort by a numeric ascending value, but it is sorting that value as if it were a word and not a number. How would I amend this expression to sort the array by a number value that is apparently stored as a text string? Let’s have a look at the issue. If we have an array of objects as...
Opening the New form from another list using SharePoint list formatting
If you want to open the new form in another list using SharePoint Lists JSON formatting, it is pretty straightforward. All you need to do is to use the href property in a link object inside of your custom HTML generated by list formatting, and point it to the relative path of the new item form of the list you want to open, for example: /sites/<your site>/Lists/<your list>/NewForm.aspx Imagine you have an issues list in...
Using Power Automate to send cards built with Cards for Power Apps in Teams
If you want to send fancier notifications to Teams and struggle with Adaptive Cards, you can now use (in preview) Cards for Power Apps to generate your cards and send them in Teams chats. Cards for Power Apps provides a straightforward experience to create Adaptive Cards that can easily be used on Teams chats. In this post, we’ll see an example of how you can send use Power Automate to send a Power Apps card in Teams based on...
My top Power Platform 2023 release wave 2 plan features
The Power Platform 2023 release wave 2 plan was recently released, and as always we get to know what are the upcoming features and updates to the platform. Check out some of the announcements that were my favourites in this post. Use Copilot to build and edit apps in the Power Apps studio New Enhanced copilot capabilities to help build apps with natural language input and run tasks like adding screens, controls, and modifying...
LookUp column with a custom icon using SharePoint list formatting
I recently got question from a follower on LinkedIn, which I thoght that the answer can be useful for more people: I am struggling with formatting a SharePoint list lookup column. I want to make it show an icon but when I click it, it should open the lookup column value on that other list (normal lookup hyperlink behavior). I have achieved this before with text fields but never with Lookups. Any help would be appreciated! How to use...
Handling variables in SharePoint custom forms built with Power Apps
It’s possible to create custom forms for SharePoint lists/libraries using Power Apps, directly from the list command bar by using the option Integrate/Power Apps/Customize the form: This allows you to create a custom form using all features that a Canvas app offers. While you can keep all the out-of-the-box SharePoint list view native features, such as sorting, filtering, grouping & using JSON formatting, you will be able to...
Customize the SharePoint command bar icons and titles with JSON formatting
Previously I posted about hiding buttons in a SharePoint list using JSON formatting using the command bar customization. The same customization features can be used to edit the buttons icons and titles, for example, below we have a custom bar that replaced some of the native buttons icons and text. By adding values to the ‘text‘ and ‘iconName‘ properties we can accomplish this. For example, if we apply the...
Customize the SharePoint command bar icons and titles with JSON formatting
Previously I posted about hiding buttons in a SharePoint list using JSON formatting using the command bar customization. The same customization features can be used to edit the buttons icons and titles, for example, below we have a custom bar that replaced some of the native buttons icons and text. By adding values to the ‘text‘ and ‘iconName‘ properties we can accomplish this. For example, if we apply the...
Customize the SharePoint command bar icons and titles with JSON formatting
Previously I posted about hiding buttons in a SharePoint list using JSON formatting using the command bar customization. The same customization features can be used to edit the buttons icons and titles, for example, below we have a custom bar that replaced some of the native buttons icons and text. By adding values to the ‘text‘ and ‘iconName‘ properties we can accomplish this. For example, if we apply the...
Customize the SharePoint command bar icons and titles with JSON formatting
Previously I posted about hiding buttons in a SharePoint list using JSON formatting using the command bar customization. The same customization features can be used to edit the buttons icons and titles, for example, below we have a custom bar that replaced some of the native buttons icons and text. By adding values to the ‘text‘ and ‘iconName‘ properties we can accomplish this. For example, if we apply the...
Customize the SharePoint command bar icons and titles with JSON formatting
Previously I posted about hiding buttons in a SharePoint list using JSON formatting using the command bar customization. The same customization features can be used to edit the buttons icons and titles, for example, below we have a custom bar that replaced some of the native buttons icons and text. By adding values to the ‘text‘ and ‘iconName‘ properties we can accomplish this. For example, if we apply the...
Customize the SharePoint command bar icons and titles with JSON formatting
Previously I posted about hiding buttons in a SharePoint list using JSON formatting using the command bar customization. The same customization features can be used to edit the buttons icons and titles, for example, below we have a custom bar that replaced some of the native buttons icons and text. By adding values to the ‘text‘ and ‘iconName‘ properties we can accomplish this. For example, if we apply the...
Customize the SharePoint command bar icons and titles with JSON formatting
Previously I posted about hiding buttons in a SharePoint list using JSON formatting using the command bar customization. The same customization features can be used to edit the buttons icons and titles, for example, below we have a custom bar that replaced some of the native buttons icons and text. By adding values to the ‘text‘ and ‘iconName‘ properties we can accomplish this. For example, if we apply the...
Customize the SharePoint command bar icons and titles with JSON formatting
Previously I posted about hiding buttons in a SharePoint list using JSON formatting using the command bar customization. The same customization features can be used to edit the buttons icons and titles, for example, below we have a custom bar that replaced some of the native buttons icons and text. By adding values to the ‘text‘ and ‘iconName‘ properties we can accomplish this. For example, if we apply the...