{"id":124,"date":"2022-01-04T12:04:18","date_gmt":"2022-01-04T12:04:18","guid":{"rendered":"https:\/\/blog.citrus-lime.com\/crmc\/?p=124"},"modified":"2022-01-04T12:04:19","modified_gmt":"2022-01-04T12:04:19","slug":"designing-and-developing-microsoft-power-apps-portals","status":"publish","type":"post","link":"https:\/\/blog.citrus-lime.com\/crmc\/designing-and-developing-microsoft-power-apps-portals\/","title":{"rendered":"Designing and Developing Microsoft Power Apps Portals"},"content":{"rendered":"\n<p>I have recently been working on a number of projects using PowerApps Portals. PowerApps Portals are a brilliant way of essentially setting up a little window into your CRM database to people outside your organisation. Portals give you the ability to give external contacts a real-time view into any records you want to share. This can be really useful if you want to keep your clients update on the progress of their cases, or allow them to update details about themselves directly in CRM, rather than having to have regular emails back and forth with updates.<\/p>\n\n\n\n<p>It\u2019s an extremely powerful tool, and with enough know-how and patience you can make use of a lot of different great functionality. However I\u2019ve also found it to be a bit of a labyrinth at times. I won\u2019t tell you how many hours I\u2019ve spent flicking between the Portal Management App and the Portal Editor or clearing the cache, but I did want to share some of my notes I\u2019ve made along the way to hopefully untangle the web a little bit (in my own head at least!)<\/p>\n\n\n\n<p><strong>1. Web Roles<\/strong><\/p>\n\n\n\n<p><br>When thinking about setting up a portal, one thing you need to be airtight on is security access. You can set up many different types of access for different users in one portal, and define these using web roles.<\/p>\n\n\n\n<p>These are like security roles in CRM, a user with a portal login will only see what they are allowed to see based on what web roles they have been assigned. In my portal, I wanted to set up two different levels of access \u2013 one for a \u2018Firm User\u2019 and one for a \u2018Firm Admin\u2019. Here all you do is create a new web role, give it a name and then select the website you\u2019re using.<\/p>\n\n\n\n<p><strong>N.B.<\/strong>&nbsp;when creating custom web roles, you want to set \u2018Authenticated Users Role\u2019 and \u2018Anonymous Users Role\u2019 to \u2018No\u2019.<br><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/clip_image001_78643872.png\" alt=\"clip_image001\" title=\"clip_image001\" \/><\/figure>\n\n\n\n<p><br><strong>2. Entity Permissions<\/strong><\/p>\n\n\n\n<p>Next you need to set up entity permissions. Here you select the entity, then define the scope, and the privileges. These work in a similar way to the regular security roles in Dynamics.<\/p>\n\n\n\n<p>I wanted the firm users to have minimal access so that they could view their own cases but nothing else, whereas the firm admins would be given access to view all cases for their company, and also would be able to view and edit contacts. In order to do this, I set up two different entity permission records for cases, and one for contacts.<\/p>\n\n\n\n<p>For the cases, I set up one \u2018Case User\u2019 \u2013 scope: Contact, privileges: Read, and associated this to the firm user web role. I set up a second \u2018Case Admin \u2013 scope: Account, privileges: Read, and associated this to the firm admin web role.<br><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><\/td><\/tr><tr><td><img loading=\"lazy\" decoding=\"async\" alt=\"clip_image003\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/clip_image003_6CCE7B33.png\" width=\"373\" height=\"221\"><\/td><td><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>For the contacts, I set up one \u2018Contact Admin\u2019 \u2013 scope Account, privileges: Read, Write Create, and associated this to the firm admin web role.<\/p>\n\n\n\n<p><strong>N.B.&nbsp;<\/strong>By default, all users have the \u2018self\u2019 permission granted, this basically just means that the user has access to view and edit details about their own contact through the \u2018profile\u2019 section which is set up automatically on any new portal. The profile page uses the \u2018Profile Web Form\u2019 which is imported as part of the managed portal solution, and can be edited as required.<\/p>\n\n\n\n<p><strong>3. Entity Forms<\/strong><\/p>\n\n\n\n<p>Entity forms are driven through system forms in Dynamics. When you create your entity form, you select the entity, then the form, then the specific tab. If you leave the tab field blank, it will default to show all tabs. You then select the \u2018mode\u2019 \u2013 the options are Insert, Edit, and ReadOnly.<\/p>\n\n\n\n<p>ReadOnly allows the user to view the details of a record in the form, either using a query string ID, or specifying a record associated to a current user (e.g. allowing a user to read details about their linked company, using a N:1 relationship to another entity). If you want to link a form here when clicking into a specific record from an entity list, you need to select \u2018Query String\u2019 for mode.<br><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><\/td><\/tr><tr><td><img loading=\"lazy\" decoding=\"async\" alt=\"clip_image005\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/clip_image005_0F2610AD.png\" width=\"374\" height=\"250\"><\/td><td><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Edit mode is the same as ReadOnly in terms of the selection of the record, but then allows the user to make changes to individual records.<\/p>\n\n\n\n<p>Insert allows users to create new records, the standard example of this that comes with the demo portal is the insert form for lead \u2018Contact Us\u2019 which has a global permissions scope and is assigned to anonymous users. This simply means that anyone can access the web page without signing in, and can enter details into the \u2018Contact Us\u2019 screen, and this will create a new lead in CRM with the submitted details.&nbsp;<strong>This option doesn\u2019t allow reading\/editing of any existing data.<\/strong><\/p>\n\n\n\n<p><strong>N.B.<\/strong>&nbsp;Any lookup field in your form is also subject to entity permissions \u2013 e.g. if you have a lookup to accounts, but you\u2019ve not given your logged in user access to view any accounts, they aren\u2019t going to be able to search or enter anything into this field.<\/p>\n\n\n\n<p><strong>4.&nbsp;Action Button Configuration<br><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><\/td><\/tr><tr><td><img loading=\"lazy\" decoding=\"async\" alt=\"clip_image007\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/clip_image007_079AA140.png\" width=\"389\" height=\"171\"><\/td><td><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><br>Under the \u2018Additional Settings\u2019 tab on the entity form, there is the option to add \u2018Action Buttons\u2019 to your form. The options you get here are based on the entity, so for the case entity you have the options to close case, resolve case, reopen case, or cancel case, whereas for the contact entity you get the options to activate or deactivate. I found the workflow option a really useful bit of functionality here, this allows the user to run any on demand workflow for a record in CRM, just by clicking a button in the portal.<\/p>\n\n\n\n<p><strong>5.&nbsp;Entity Lists<br><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><\/td><\/tr><tr><td><img loading=\"lazy\" decoding=\"async\" alt=\"clip_image009\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/clip_image009_29F236B9.png\" width=\"395\" height=\"189\"><\/td><td><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Entity lists are driven through system views in Dynamics. You first select the entity, then select the views available from the drop-down. You can select multiple views to allow the user to switch between them, and you can also add extra manual filters to the view results at the bottom of the page.<\/p>\n\n\n\n<p>It\u2019s important to tick the \u2018Enable Entity Permissions\u2019 box half-way down the page, as this will let users view whichever records you have allowed them to in the entity permissions section.<\/p>\n\n\n\n<p>This means that you can set up just one entity list for a web page, and then different users will see different things based on their security access. For this portal, I set up one \u2018Cases\u2019 entity list, and I allowed firm users to view only their cases (the contact scope) and the firm admins to view their own and their company\u2019s cases (the account scope).<\/p>\n\n\n\n<p><strong>6. Web page for details view<\/strong><\/p>\n\n\n\n<p>Add a web page here with an entity form to allow the user to click into any record in the list to view the details of the record. This form must be in \u2018ReadOnly\u2019 or \u2018Edit\u2019 mode, and the record source type must be \u2018QueryString\u2019, to ensure the user sees the record they have clicked into.<\/p>\n\n\n\n<p><strong>6a. Web Page for Create<\/strong><\/p>\n\n\n\n<p>Add a web page here with an entity form to allow the user to create a new record from the list view. This form must be in \u2018Insert\u2019 mode, and the logged in user must have the sufficient entity permissions to create the entity type.<\/p>\n\n\n\n<p><strong>6b. Web Pages<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><\/td><\/tr><tr><td><img loading=\"lazy\" decoding=\"async\" alt=\"clip_image011\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/clip_image011_7B9B41BC.jpg\" width=\"420\" height=\"276\"><\/td><td><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Web pages are what makes up the portal. You choose the partial URL, the page template, and then you define the content of the page. As soon as you create a web page, a \u2018localised content\u2019 version of that web page is automatically created. The localised content page is where the page title and content can be viewed and amended via the HTML\/designer box.<\/p>\n\n\n\n<p><strong>6c. Web Page Access Control Rules<\/strong><\/p>\n\n\n\n<p>Web page access control rules allow you to define the level of editing power any user has over your portal, and allow you to restrict certain pages of the website to being only viewed by. Grant Change allows users to make changes to the content of the web page, while Restrict Read allows you to specify that only users with certain web roles can view the web page.<\/p>\n\n\n\n<p>These rules work with cascading effect down to child web pages, so make sure you are certain that you want to grant changes\/restrict read of all pages under the page before you apply the rule! It\u2019s also important to remember to add the publishing state \u2018published\u2019 to your web page access control rule once you\u2019ve completed it for the rule to take effect.<\/p>\n\n\n\n<p><strong>6d. Web Link Sets<\/strong><\/p>\n\n\n\n<p>Web link sets define different areas of navigation in the portal. This is really important as it is what defines how your user will navigate around the portal, if you don\u2019t want them to have to follow specific partial URLs to view your different web pages.<\/p>\n\n\n\n<p>The primary navigation set defines what appears along the top bar, the profile navigation defines the pages available under the user profile section. Web links make up the web link sets, in here you choose the web page, the display order number, and whether there is a parent web link. In the primary navigation set, if you set a web link to have no parent web link, it will appear as a new button on the top bar. If you set a parent web link, it will appear under that web link as a drop down. For example, I set \u2018Cases\u2019 to have no parent web link, and \u2018New Firm\u2019 to have a parent web link of \u2018Home\u2019.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/clip_image013_68E64805.png\" alt=\"clip_image013\" title=\"clip_image013\" \/><\/figure>\n\n\n\n<p><strong>Things to Consider<\/strong><\/p>\n\n\n\n<p>As I\u2019m normally working in a couple of different Microsoft environments for different clients, I like to stay in private browsing mode. However, for whatever reason &#8211; the Portal Editor doesn\u2019t work in private browsing mode! This caught me out too many times, and is a bit of a pain, but just something to be aware of if you also like to stay incognito in your browser.<\/p>\n\n\n\n<p>I generally find the Portal Editor to be a bit slow to use, when it\u2019s working well it\u2019s great to be able to see your changes as you\u2019re making them, but I actually ended up doing most of my editing through the Portal Management App in Dynamics. This I found was harder to get my head around at first than the Portal Editor, but much easier to make quick changes to (at the time of writing anyway).<\/p>\n\n\n\n<p>Caching is another thing to be very aware of when editing the portal, if you\u2019ve made some changes and aren\u2019t seeing them in effect \u2013 usually clearing your browser\u2019s cache will fix it. If this still isn\u2019t working, then clicking the \u2018Sync Configuration\u2019 and then \u2018Browse Website\u2019 buttons at the top RHS of the Portal Editor always did the trick for me to see the most up to date changes I\u2019d made either in the Portal Management App or in the Portal Editor.<br><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/license.citruslime.com\/cs\/blogs\/crmcs\/clip_image014_11F0E702.png\" alt=\"clip_image014\" title=\"clip_image014\" \/><\/figure>\n\n\n\n<p><strong>We hope you found Jess\u2019s article helpful and informative. She has recently published some other informative CRMCS articles on using the Power Platform, just visit our&nbsp;<\/strong><a href=\"https:\/\/www.crmcs.co.uk\/blog\/blog.aspx\"><strong>CRMCS Blog<\/strong><\/a><strong>&nbsp;for more\u2026<\/strong><\/p>\n\n\n\n<p><strong>If you\u2019d like to us to delve into anything in particular or want to discuss something from this article, then please email us at&nbsp;<\/strong><a><strong>contact@crmcs.co.uk<\/strong><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have recently been working on a number of projects using PowerApps Portals. PowerApps Portals are a brilliant way of essentially setting up a little window into your CRM database to people outside your organisation. Portals give you the ability to give external contacts a real-time view into any records you want to share. This<\/p>\n","protected":false},"author":43,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_price":"","_stock":"","_tribe_ticket_header":"","_tribe_default_ticket_provider":"","_tribe_ticket_capacity":"0","_ticket_start_date":"","_ticket_end_date":"","_tribe_ticket_show_description":"","_tribe_ticket_show_not_going":false,"_tribe_ticket_use_global_stock":"","_tribe_ticket_global_stock_level":"","_global_stock_mode":"","_global_stock_cap":"","_tribe_rsvp_for_event":"","_tribe_ticket_going_count":"","_tribe_ticket_not_going_count":"","_tribe_tickets_list":"[]","_tribe_ticket_has_attendee_info_fields":false,"footnotes":""},"categories":[3],"tags":[],"class_list":{"0":"post-124","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-crm"},"featured_image_src":null,"author_info":{"display_name":"jadesmith","author_link":"https:\/\/blog.citrus-lime.com\/crmc\/author\/jadesmith\/"},"_links":{"self":[{"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/posts\/124","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/users\/43"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/comments?post=124"}],"version-history":[{"count":1,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/posts\/124\/revisions"}],"predecessor-version":[{"id":125,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/posts\/124\/revisions\/125"}],"wp:attachment":[{"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/media?parent=124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/categories?post=124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.citrus-lime.com\/crmc\/wp-json\/wp\/v2\/tags?post=124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}