Filtering Dataverse data by the current user in Cards for Power Apps
Bildquelle: Shutterstock.com
Power Apps
18. Aug 2023 18:00

Filtering Dataverse data by the current user in Cards for Power Apps

von HubSite 365 über Michel Mendes [MVP]

Microsoft MVP | Senior Consultant at Avanade | Microsoft 365 | Power Platform | SharePoint

Citizen DeveloperPower AppsMicrosoft DataverseLearning Selection

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

The text discusses data filtering in Power Apps using the 'User Power Fx' function, which is replaced by 'Viewer' in Cards. The Viewer object utilizes three properties - name, aadObjectId, and id - to filter data. The preferred choice is aadObjectId due to its precision, as names may not always be unique. To filter items created by a user in a Dataverse table, the 'Created By' and 'Azure AD Object Id' filter formula is used.

However, delegation is currently not supported for the filter function in Cards. The filtered values can be used in the Fact set, using the syntax provided. The LookUp function can also be used to filter results by the current user. The LookUp supports delegation but has limitations like not supporting filtering data by a column other than the Id column. Results can be viewed directly in the player or pasted on Teams.

In conclusion, using the Viewer.aadObjectId property aids in filtering data related to the current user in cards. It's however vital to remember that delegation only works partially in Cards as of now, with a prospective full support in the future.

Highlights: Delegating Data Filtering in Power Apps

The 'Viewer' object is a significant development in Power Apps that assists in data filtering, especially for data associated with a current user. It harnesses the aadObjectId property for precision and overall efficiency. Interestingly, the LookUp function backs delegation but has constraints - it does not support data filtering by a column outside the Id column.

Overall, while the partial functionality of delegation in Cards is an issue, expectations are high for future improvements. Therefore, the Viewer.aadObjectId property is a valuable tool in data filtering in Power Apps.

Read the full article Filtering Dataverse data by the current user in Cards for Power Apps

Learn about Filtering Dataverse data by the current user in Cards for Power Apps

Filtering data in Power Apps cards by the current user requires the use of a new object called Viewer, which has three properties that can be used to filter data: name, aadObjectId, and id. Filtering data by the user's display name can be tricky, so it is best to use the aadObjectId for a more precise result. To filter data in a Dataverse table, the filter formula should use the 'Created By' and the 'Azure AD Object Id', and delegation is not currently supported. The LookUp function can also be used to filter results, but only by the Id column and with delegation support. When running the card in the player/pasting it into Teams, the filtered items from the table will be displayed. While delegation support is not fully available yet, the Viewer object can be used to filter data associated/created by the current user in cards.

 

More links on about Filtering Dataverse data by the current user in Cards for Power Apps

3 Ways To Filter A Power Apps Gallery By The Current User
Feb 6, 2022 — The easiest way is to get the current user's email and use a filter function to show only matching records in the gallery. A more secure way is ...
Filter Gallery by current user - Power Platform Community
Jul 1, 2019 — Filter Gallery by current user · 1. Check for a matching email address. Use this code in the OnStart property of the app: Set(varUserEmail, User() ...
How to Filter Gallery by Current User in Power Apps
Jun 15, 2023 — This Power Apps tutorial explains how to filter gallery by current user in Power Apps with various examples.
Power Apps Filter Records For Logged In User
Mar 8, 2021 — 3) You can filter your records either based on the currently logged-in user or by having a drop-down selection of the individual email addresses ...
Filter Gallery based off current user (assigned in second list)
Sep 26, 2022 — I want to filter a gallery of tasks assigned to the current user (or ... on creating an expense report app with powerapps using dataverse as ...
Power Apps Cards - How to Make Planning Poker
6 days ago — Column set with 2 columns ( Repeat for Every set to filtered Dataverse Table); Column 1 label - Dev name from Dataverse; Column 2 label - Points ...
Filter function in Canvas Power Apps | Power Fx Formula ...
Nov 20, 2022 — Start by typing Filter while the target Gallery is selected under Items property and you'll see that it's a valid function in the list. · Now, ...

Keywords

Microsoft Expert,Filtering Dataverse data,User Power Fx,Viewer Object,Azure AD Object Id,GUID