Hi
I've built PowerApps for sometime and just started to venture into Power Pages.
As a first step I'm trying to split out front desk (using Power Pages) and back office (using PowerApps), sharing a common Dataverse environment. (For the moment Power Pages will be used for 'lighter' applications and the heavy work to be done in PowerApps.)
Within PowerApps I can use the Office365Users connector to identify the user and use this to look up various user values e.g. Line Manager.
The Power Pages site will require all users to authenticate to access some areas.
Importantly, I need to be able to retrieve the user details and then pass this to filters to extract information relevant to the user only.
I also need to be able to extract values from one table (say UID) and pass this to a field in another table.
From what I can find out it appears that Liquid will do what I need.
However, the information I've found so far is a bit like picking up a book with the first two chapters missing.
The information on Microsoft learn is useful as long as you know where to put the liquid code in the first place.
For example, this snippet {{ page.title }} is supposed to display the page name on the page but where to you paste the code?
My initial (urgent) requirement is to:
1. Identify the logged in user (maybe use this in a welcome message e.g. Hi {{ user }}, welcome to the site) - this also confirms the user is identified.
2. Assuming that the user identity includes their email address, use this to match and pull their record from a Dataverse table.
3. Use the user UID from the Dataverse table and pass this as the foreign key to fields in other Dataverse tables.
I've probably missed the obvious but I doubt that I'm the only one figuring out the details.
Thanks in advance.
Many thanks for your help so far - I can certainly recommend the XRMToolbox for creating the Fetch query.
For anyone else finding this post there are a couple of additional final steps required to display the returned information from Fetch in the Power Pages page, as follows:
You then need to do something with the output/result.
In my above example only one result will be returned.
(Apologies in advance.)
There two final bits that are escaping me... I'm hoping these are possible.
In the final part of my example above I'm passing the returned values to variables.
Is it possible to...
A) Pass the variable e.g. {{ userEmail }} to be used within a list to filter it.
I've tried using the value in the view filter but this returns nothing - adding the email directly produces the correct outcome.
B) Pre-populate form values with variables
Thanks in advance.
My IT guys have approved the use of the XRMToobox so I'll be giving it a go - looks promising.
In the meantime (if anyone else finds this post) I'd highly recommend the Microsoft Learn section on Liquid https://learn.microsoft.com/en-us/training/modules/power-pages-liquid/
Suggestion to Microsoft.
Please can you make the link to the Power Pages training more obvious!
It would also help if there were direct links in the documentation to the relevant training module.
Hi @Gary_Eden
Sure. The simple way is to use the fetchxml builder to build your query.
Can you try the FetchXML builder from the XRM toolbox?
https://www.xrmtoolbox.com/plugins/Cinteros.Xrm.FetchXmlBuilder/
Try playing around with different combinations and see if that works for you.
Hope it helps.
------------
If you like this post, give it a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.
I've managed to make some progress and I'm now able to pull the authenticated user information details from the Contacts table using
Thanks for your help.
I'd found the links before but I was overthinking everything - I hadn't realised that Liquid is just a mark-up language. Reading your reply helped make the connection.
So for anyone else finding this post, here's the Liquid example added to a text block on a page.
And this is what is displayed when previewed (I'm running unauthenticated at the moment).
Now to have some fun.
Hi @Gary_Eden
Welcome to the power pages forum. Your understanding is right. Power Pages will work based on authenticated users. There are different types of logins used in Power Pages.
1. Local Authentication ( will be deprecated. Link here)
2. Azure AD (Link here)
3. Azure AD B2C (Link here)
Note: Recommended authentication is Azure AD B2C but you can do Azure AD also.
Once the user is logged in to the Power Pages site. Then you can use the liquid object to display the welcome message.
Example here:
{% if user %}
Hello, {{ user.fullname | escape }}!
{% else %}
Hello, anonymous user!
{% endif %}
For Q2: All user details are stored in the "Contacts" Table by default. So you can utilise this table and fetch email addresses and all other relevant details ( This is applicable once the user is authenticated). Power Pages will create a contact in the contacts table once the authentication is successful.
For Q3: Related to the Q2 answer. You can use a unique GUID or set any other fields as per your requirement.
Most important: To make liquid work, You should set appropriate table permissions to the contacts and web roles too. Link here
Have fun. Hope the above info gives you some idea to get started.
Hope it helps.
------------
If you like this post, give it a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.
Fubar
69
Super User 2025 Season 1
oliver.rodrigues
49
Most Valuable Professional
Jon Unzueta
43