{"id":3249,"date":"2020-10-04T20:53:02","date_gmt":"2020-10-04T18:53:02","guid":{"rendered":"http:\/\/www.extradrm.com\/?p=3249"},"modified":"2020-10-04T20:53:02","modified_gmt":"2020-10-04T18:53:02","slug":"pa-5-of-5-best-technique-to-security-trim-form-fields-powerapps-tutorial-for-beginners","status":"publish","type":"post","link":"https:\/\/www.extradrm.com\/?p=3249","title":{"rendered":"PA: 5 of 5 | Best Technique to Security Trim Form Fields &#8211; PowerApps Tutorial for Beginners"},"content":{"rendered":"<p>From time to time you run into that business requirement that requires several roles within the business process, where you need to hide or show fields based on those roles. <\/p>\n<p>In this video we will walkthrough a pattern to build custom roles for a business process, manage them within a SharePoint list, as well as, building business logic to secure form fields based on those roles. <\/p>\n<p>As an example, only show the cost field for Approvers and Admins, or Only allow the description field to be edited if the status is Submitted, or if the current user is an Admin. <\/p>\n<p>When we say &#8220;admin&#8221; we are not referring to Site Collection admins nor site owners, but rather a custom admin, approver, and buyer roles we invented for our business process. <\/p>\n<p>You will want to watch this video in it&#8217;s entirety, as there is a critical security concern that must be addressed when trying to security trim Form fields. You must ensure you &#8220;harden&#8221; your list(s). <\/p>\n<p>This is a critical technique to grasps, as every business process will have various custom roles, and knowing how to implement this elegantly in PowerApps is essential to your success.  <\/p>\n<p>Here&#8217;s some Syntax used in this video, you just need to adjust for your ACL list name and\/or custom roles that you define.<br \/>\n===================<br \/>\nDetermine if the current user is an admin, and sets the global variable to true or false<\/p>\n<p>Set(isAdmin, LookUp(ACL_Equipment, User.Email=User().Email&#038;&#038;Title=&#8221;Equipment 2&#8243;&#038;&#038;Role.Value=&#8221;Admin&#8221;, ID 0));<\/p>\n<p>Determine if the current user created the current item<\/p>\n<p>If(User().Email=ThisItem.Author.Email,DisplayMode.Edit, DisplayMode.Disabled)<\/p>\n<p>Also, here is the URL to read-up on the 3 main PowerApps functions: Search, Filter, and Lookup.<br \/>\nhttps:\/\/docs.microsoft.com\/en-us\/powerapps\/maker\/canvas-apps\/functions\/function-filter-lookup  <\/p>\n<p>Lastly, when dealing with very large lists, ensure you get an understanding with delegation function calls, and how it will dramatically improve performance. <\/p>\n<p>#powerapps #infopathmigration #sharepoint #microsoft365solutions<\/p>\n<p>? Subscribe to SPClassroom SharePoint and o365 videos &#8211; https:\/\/www.youtube.com\/user\/clardo11?sub_confirmation=1<\/p>\n<p>SPClassroom is a collection of sharepoint developer tutorials for SharePoint 2013, SP2016, SharePoint Online, office365, and SPFx SharePoint Developer&#8217;s Framework, with a focus on training videos for Power Users, Developers, and SharePoint Architects. <\/p>\n<p>Find More SharePoint Developer Tutorial, o365 Development Training, and SharePoint Training Videos here:<\/p>\n<p>Youtube: https:\/\/www.youtube.com\/user\/clardo11<br \/>\nLinkedIn: https:\/\/www.linkedin.com\/in\/deshonclark<br \/>\nFacebook: https:\/\/www.facebook.com\/spclassroom\/<br \/>\nTwitter: https:\/\/twitter.com\/spclassroom<br \/>\nWebsite: http:\/\/spclassroom.com<br \/>\nSnapchat: deshon.clark<\/p>\n","protected":false},"excerpt":{"rendered":"<p>From time to time you run into that business requirement that requires several roles within the business process, where you need to hide or show fields based on those roles. In this video we&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":3250,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"video","meta":[],"categories":[548,547],"tags":[286,416,574,578,579],"youtube_video":{"channel_id":"UCGIwZKWio310dymWzWo5-PA","channel_title":"DeShon Clark","title":"PA: 5 of 5 | Best Technique to Security Trim Form Fields - PowerApps Tutorial for Beginners","description":"From time to time you run into that business requirement that requires several roles within the business process, where you need to hide or show fields based on those roles. \r\n\r\nIn this video we will walkthrough a pattern to build custom roles for a business process, manage them within a SharePoint list, as well as, building business logic to secure form fields based on those roles. \r\n\r\nAs an example, only show the cost field for Approvers and Admins, or Only allow the description field to be edited if the status is Submitted, or if the current user is an Admin. \r\n\r\nWhen we say \"admin\" we are not referring to Site Collection admins nor site owners, but rather a custom admin, approver, and buyer roles we invented for our business process. \r\n\r\nYou will want to watch this video in it's entirety, as there is a critical security concern that must be addressed when trying to security trim Form fields. You must ensure you \"harden\" your list(s). \r\n\r\nThis is a critical technique to grasps, as every business process will have various custom roles, and knowing how to implement this elegantly in PowerApps is essential to your success.  \r\n\r\nHere's some Syntax used in this video, you just need to adjust for your ACL list name and\/or custom roles that you define. \r\n===================\r\nDetermine if the current user is an admin, and sets the global variable to true or false\r\n\r\nSet(isAdmin, LookUp(ACL_Equipment, User.Email=User().Email&&Title=\"Equipment 2\"&&Role.Value=\"Admin\", ID 0));\r\n\r\n\r\nDetermine if the current user created the current item\r\n\r\nIf(User().Email=ThisItem.Author.Email,DisplayMode.Edit, DisplayMode.Disabled)\r\n\r\n\r\nAlso, here is the URL to read-up on the 3 main PowerApps functions: Search, Filter, and Lookup. \r\nhttps:\/\/docs.microsoft.com\/en-us\/powerapps\/maker\/canvas-apps\/functions\/function-filter-lookup  \r\n\r\nLastly, when dealing with very large lists, ensure you get an understanding with delegation function calls, and how it will dramatically improve performance. \r\n\r\n\r\n\r\n#powerapps #infopathmigration #sharepoint #microsoft365solutions\r\n\r\n\r\n? Subscribe to SPClassroom SharePoint and o365 videos - https:\/\/www.youtube.com\/user\/clardo11?sub_confirmation=1\r\n\r\n\r\nSPClassroom is a collection of sharepoint developer tutorials for SharePoint 2013, SP2016, SharePoint Online, office365, and SPFx SharePoint Developer's Framework, with a focus on training videos for Power Users, Developers, and SharePoint Architects. \r\n\r\n\r\nFind More SharePoint Developer Tutorial, o365 Development Training, and SharePoint Training Videos here:\r\n\r\nYoutube: https:\/\/www.youtube.com\/user\/clardo11\r\nLinkedIn: https:\/\/www.linkedin.com\/in\/deshonclark\r\nFacebook: https:\/\/www.facebook.com\/spclassroom\/\r\nTwitter: https:\/\/twitter.com\/spclassroom\r\nWebsite: http:\/\/spclassroom.com\r\nSnapchat: deshon.clark","category_id":"27","category":"Education","tags":["sharepoint","sharepointandangularjs","odata","sharepointlargelists","office 365","o365","share point","powerapps","powerapps security","powerapps custom roles"],"duration":2735,"iso_duration":"PT45M35S","human_duration":"45:35","definition":"hd","thumbnails":{"default":{"url":"https:\/\/i.ytimg.com\/vi\/K9TiJwR-ukM\/default.jpg","width":120,"height":90},"medium":{"url":"https:\/\/i.ytimg.com\/vi\/K9TiJwR-ukM\/mqdefault.jpg","width":320,"height":180},"high":{"url":"https:\/\/i.ytimg.com\/vi\/K9TiJwR-ukM\/hqdefault.jpg","width":480,"height":360},"standard":{"url":"https:\/\/i.ytimg.com\/vi\/K9TiJwR-ukM\/sddefault.jpg","width":640,"height":480},"maxres":{"url":"https:\/\/i.ytimg.com\/vi\/K9TiJwR-ukM\/maxresdefault.jpg","width":1280,"height":720}},"video_id":"K9TiJwR-ukM","published":"2018-11-15T19:58:22Z","stats":{"comments":"35","views":"5380","likes":"73","dislikes":"1","favourite":"0"},"privacy":{"status":"public","embeddable":true,"license":"youtube"}},"_links":{"self":[{"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/posts\/3249"}],"collection":[{"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3249"}],"version-history":[{"count":0,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/posts\/3249\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/media\/3250"}],"wp:attachment":[{"href":"https:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}