{"id":18920,"date":"2019-06-10T09:38:57","date_gmt":"2019-06-10T09:38:57","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=18920"},"modified":"2022-07-19T16:22:24","modified_gmt":"2022-07-19T10:52:24","slug":"filter-records-powerapps-based-on-the-owner-of-the-record-in-dynamics-365-ce","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2019\/06\/filter-records-powerapps-based-on-the-owner-of-the-record-in-dynamics-365-ce\/","title":{"rendered":"Filter records in PowerApps based on the owner of the record in Dynamics 365 CE"},"content":{"rendered":"<h2><strong>Introduction<\/strong><\/h2>\n<p>In today\u2019s blog we will explore how to filter records in PowerApps of Dynamics 365 CRM based on the logged in user in the PowerApps.<\/p>\n<p>Now I have created a default Canvas app for Account entity. As you can see in below screenshot, the list contains all the account records belonging to different users:<\/p>\n<p style=\"padding-left: 80px;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-18924\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/06\/1PowerApps-Dynamics-365.png\" alt=\"PowerApps Dynamics 365\" width=\"439\" height=\"788\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/06\/1PowerApps-Dynamics-365.png 439w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/06\/1PowerApps-Dynamics-365-167x300.png 167w\" sizes=\"(max-width: 439px) 100vw, 439px\" \/><\/p>\n<p>Now we have to filter the records based on the logged in user in PowerApps. To achieve this please follow the below steps:<\/p>\n<p><strong>1<\/strong>. Create a default Canvas app for appointment entity by using Dynamics 365 CRM. You can refer our previous blog <a href=\"https:\/\/www.inogic.com\/blog\/2018\/07\/create-records-in-dynamics-365-with-canvas-powerapp\/\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/p>\n<p><strong>2<\/strong>. Now, edit the \u201cItem\u201d property of BrowseGallery:<\/p>\n<p>SortByColumns(<\/p>\n<p>Filter(<\/p>\n<p>Accounts,<\/p>\n<p>Owner = LookUp(<\/p>\n<p>Users,<\/p>\n<p>&#8216;User Name&#8217; = User().Email,<\/p>\n<p>User<\/p>\n<p>)<\/p>\n<p>),<\/p>\n<p>&#8220;emailaddress1&#8221;,<\/p>\n<p>&#8220;address1_city&#8221;,<\/p>\n<p>&#8220;name&#8221;,<\/p>\n<p>If(<\/p>\n<p>SortDescending1,<\/p>\n<p>Descending,<\/p>\n<p>Ascending<\/p>\n<p>)<\/p>\n<p>)<\/p>\n<p>Please see the screenshot below:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-18922\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/06\/2PowerApps-Dynamics-365.png\" alt=\"PowerApps Dynamics 365\" width=\"1422\" height=\"547\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/06\/2PowerApps-Dynamics-365.png 1422w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/06\/2PowerApps-Dynamics-365-300x115.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/06\/2PowerApps-Dynamics-365-768x295.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/06\/2PowerApps-Dynamics-365-1024x394.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/06\/2PowerApps-Dynamics-365-660x254.png 660w\" sizes=\"(max-width: 1422px) 100vw, 1422px\" \/><\/p>\n<p>The above formula filters the account records by implementing the condition if ownerid is equal to the logged in user by using the function User() in PowerApps.<\/p>\n<p>The User() function in PowerApps returns the information as Email, Full Name and Image about current logged in user in PowerApps.<\/p>\n<p>You can refer <a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/maker\/canvas-apps\/functions\/function-user\" target=\"_blank\" rel=\"noopener noreferrer\">this blog<\/a> to gets more details.<\/p>\n<p><strong>3<\/strong>. Now log in to the other user and you will see the app contains those account records which belongs to the user:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-18923\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/06\/3PowerApps-Dynamics-365.png\" alt=\"PowerApps Dynamics 365\" width=\"423\" height=\"719\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/06\/3PowerApps-Dynamics-365.png 423w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/06\/3PowerApps-Dynamics-365-176x300.png 176w\" sizes=\"(max-width: 423px) 100vw, 423px\" \/><\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>By implementing the above steps we can filter records of Dynamics 365 CRM in PowerApps based on the owner of the records.<\/p>\n<h2 style=\"text-align: left;\"><div class=\"su-heading su-heading-style-default su-heading-align-center\" id=\"\" style=\"font-size:15px;margin-bottom:5px\"><div class=\"su-heading-inner\">70% of global 2000 companies apply gamification to improve productivity and returns!<\/div><\/div><\/h2>\n<p><em><strong><a href=\"https:\/\/bit.ly\/3RD4lYW\" target=\"_blank\" rel=\"noopener noreferrer\">Gamifics365<\/a> <\/strong>\u2013 Spin the magic of games within Microsoft Dynamics 365 CRM to improve user adoption, enhance productivity, and achieve company goals!<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In today\u2019s blog we will explore how to filter records in PowerApps of Dynamics 365 CRM based on the logged in user in the PowerApps. Now I have created a default Canvas app for Account entity. As you can see in below screenshot, the list contains all the account records belonging to different users:\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2019\/06\/filter-records-powerapps-based-on-the-owner-of-the-record-in-dynamics-365-ce\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":23728,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[38,44],"tags":[1881],"class_list":["post-18920","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-microsoft-powerapps","category-power-apps","tag-powerapps-dynamics-365"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/18920","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=18920"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/18920\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media\/23728"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=18920"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=18920"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=18920"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}