{"id":12455,"date":"2018-07-23T17:58:57","date_gmt":"2018-07-23T12:28:57","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=12455"},"modified":"2022-07-21T12:18:45","modified_gmt":"2022-07-21T06:48:45","slug":"create-customer-lookup-in-powerapps-using-data-context","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2018\/07\/create-customer-lookup-in-powerapps-using-data-context\/","title":{"rendered":"Create Customer Lookup in PowerApps using Data Context"},"content":{"rendered":"<h2><strong>Introduction:<\/strong><\/h2>\n<p>Recently, we had a business requirement to show customer lookup in PowerApps similar to the customer lookup in Dynamic 365.<\/p>\n<p>For example \u2013 In Dynamic 365, we have customer lookup of contact and account, using this we can select contact and account.<\/p>\n<p>To achieve the same thing in PowerApps, we have to use <strong>\u201cContext\u201d <\/strong>parameter of navigation methods.<\/p>\n<p>For more details about navigation, methods refer below link.<\/p>\n<p><a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/maker\/canvas-apps\/functions\/function-navigate\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/docs.microsoft.com\/en-us\/powerapps\/maker\/canvas-apps\/functions\/function-navigate<\/a><\/p>\n<p><strong>Solution:<\/strong><\/p>\n<p><strong>Step 1: <\/strong>Select a Blank application as shown in below screenshot.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-14778\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/02\/1PowerApps.png\" alt=\"PowerApps\" width=\"1285\" height=\"500\" \/><\/p>\n<p><strong>Step 2: <\/strong>Add two Blank Screen one is Home Screen and Customer Screen which will display account and contact list.<\/p>\n<p style=\"padding-left: 90px;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-14779\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/02\/2PowerApps.png\" alt=\"PowerApps\" width=\"360\" height=\"370\" \/><\/p>\n<p><strong>Step 3:\u00a0<\/strong>Add Dropdown Control, Textbox, search icon on Home Screen as below.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-14780\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/02\/3PowerApps.png\" alt=\"PowerApps\" width=\"944\" height=\"375\" \/><\/p>\n<p><strong>Step 4:\u00a0<\/strong>Add data source of account and contact in PowerApps as shown in the below screenshot.<\/p>\n<p>To add Source Go to View-&gt; Data Source -&gt; +Add data source<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-14781\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/02\/4PowerApps.png\" alt=\"PowerApps\" width=\"1111\" height=\"350\" \/><\/p>\n<p>After that Click on Add data Source, the below screen will appear,<\/p>\n<p style=\"padding-left: 90px;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-14782\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/02\/5PowerApps.png\" alt=\"PowerApps\" width=\"331\" height=\"363\" \/><\/p>\n<p>If u have different data source then select that one. Here we have selected a Dynamic 365.<\/p>\n<p>Click on Dynamic 365 then select required entity. I have selected Account. After selecting entity click on <strong>Connect, <\/strong>data source will get added to PowerApps. Similarly we can add Contacts data source as shown in below screenshot.<\/p>\n<p style=\"padding-left: 90px;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-14783\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/02\/6PowerApps.png\" alt=\"PowerApps\" width=\"317\" height=\"520\" \/><\/p>\n<p>After successful setup it looks like below.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-14784\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/02\/7PowerApps.png\" alt=\"PowerApps\" width=\"1121\" height=\"576\" \/><\/p>\n<p><strong>Step 5:\u00a0<\/strong>Add gallery two controls to \u201c<strong>CustomerScreen\u201d <\/strong>as shown in below screenshot<strong>.<\/strong><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-14785\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/02\/8PowerApps.png\" alt=\"PowerApps\" width=\"939\" height=\"433\" \/><\/p>\n<p><strong>Step 6: <\/strong>Go to HomeScreen select dropdown, to set dropdown value, I have define entityList collection which consist of entityName as property. These will display data on dropdownlist.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-14786\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/02\/9PowerApps.png\" alt=\"PowerApps\" width=\"1405\" height=\"480\" \/><\/p>\n<p><strong>Step 7: <\/strong>Now set Items property of dropdown to entityList Collection as shown below.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-14787\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/02\/10PowerApps.png\" alt=\"PowerApps\" width=\"1101\" height=\"307\" \/><\/p>\n<p><strong>Step 8: <\/strong>Now add below lines of code in <strong>onSelect<\/strong> property of dropdown.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-14788\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/02\/11PowerApps.png\" alt=\"PowerApps\" width=\"1385\" height=\"436\" \/><\/p>\n<p><strong>Step 9:\u00a0<\/strong>Select Search Icon of Textbox then add navigate function as shown below.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-14789\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/02\/12PowerApps.png\" alt=\"PowerApps\" width=\"1143\" height=\"449\" \/><\/p>\n<p><strong>Step 10:\u00a0<\/strong>Go to <strong>CustomerScreen<\/strong> and set <strong>Items<\/strong> property Contact and Account Gallery to Source collection that define in navigate function.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-14790\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/02\/13PowerApps.png\" alt=\"PowerApps\" width=\"1112\" height=\"530\" \/><\/p>\n<p><strong>Step 11:\u00a0<\/strong>To display only one gallery at a time set <strong>visible<\/strong> property of account and contact gallery as shown below<\/p>\n<p><strong>Contact Gallery<\/strong><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-14791\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/02\/14PowerApps.png\" alt=\"PowerApps\" width=\"1110\" height=\"514\" \/><\/p>\n<p><strong>Account Gallery<\/strong><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-14792\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/02\/15.png\" alt=\"PoweraApps\" width=\"1111\" height=\"518\" \/><\/p>\n<p><strong>Step 12:\u00a0<\/strong>To display selected data on <strong>HomeScreen<\/strong> Textbox, use Set function on OnSelect property of nextArrow Icon as shown in screenshot.<\/p>\n<p><strong>Contact Gallery<\/strong><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-14793\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/02\/16PowerApps.png\" alt=\"PowerApps\" width=\"1107\" height=\"501\" \/><\/p>\n<p><strong>Account Gallery<\/strong><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-14794\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/02\/17PowerApps.png\" alt=\"PowerApps\" width=\"1112\" height=\"630\" \/><\/p>\n<p><strong>Step 13:\u00a0<\/strong>Go to <strong>HomeScreen<\/strong> and set <strong>default<\/strong> property of textbox as shown in below screenshot.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-14795\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/02\/18PowerApps.png\" alt=\"PowerApps\" width=\"1410\" height=\"356\" \/><\/p>\n<blockquote><p>Note: Instead of Dropdown control, we can use <strong>radio Button. <\/strong>Now simply run the application.<\/p><\/blockquote>\n<h2><strong>Conclusion: <\/strong><\/h2>\n<p>Using the simple steps above user can create customer lookup in PowerApps using data context.<\/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: Recently, we had a business requirement to show customer lookup in PowerApps similar to the customer lookup in Dynamic 365. For example \u2013 In Dynamic 365, we have customer lookup of contact and account, using this we can select contact and account. To achieve the same thing in PowerApps, we have to use \u201cContext\u201d\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2018\/07\/create-customer-lookup-in-powerapps-using-data-context\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":12457,"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":[16,18,19,44,38],"tags":[562,655,1171],"class_list":["post-12455","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dynamics-365","category-dynamics-365-v9-2","category-dynamics-crm","category-power-apps","category-microsoft-powerapps","tag-dynamics-365-microsoft-powerapps","tag-dynamics-crm-microsoft-powerapps","tag-microsoft-powerapps-dynamics-crm"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/12455","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=12455"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/12455\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media\/12457"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=12455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=12455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=12455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}