{"id":391,"date":"2018-06-29T13:54:44","date_gmt":"2018-06-29T11:54:44","guid":{"rendered":"http:\/\/cwiok.pl\/?p=391"},"modified":"2018-07-04T09:03:19","modified_gmt":"2018-07-04T07:03:19","slug":"processing-analysis-services-table-in-powerapps","status":"publish","type":"post","link":"https:\/\/cwiok.pl\/index.php\/en\/2018\/06\/29\/processing-analysis-services-table-in-powerapps\/","title":{"rendered":"Processing Analysis Services Table in PowerApps"},"content":{"rendered":"<p>This tutorial was requested by one of our clients. His app was connected to DWH, which was the source for the Analysis Services. After the data was input into the edit form, the task was to start processing the table to see it through Power BI.<\/p>\n<p><a href=\"http:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/artyku\u0142_07.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-404 size-full\" src=\"http:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/artyku\u0142_07.png\" alt=\"\" width=\"1200\" height=\"628\" srcset=\"https:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/artyku\u0142_07.png 1200w, https:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/artyku\u0142_07-300x157.png 300w, https:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/artyku\u0142_07-768x402.png 768w, https:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/artyku\u0142_07-1024x536.png 1024w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<p>As a prerequisite, check if you have all the permissions to create new resources in your Azure subscription and have credentials that can be used to authenticate with the AS server.<\/p>\n<p>My proposed solution:<\/p>\n<p>1. After setting up the cube click \u201cCreate a resource\u201d:<br \/>\n<a href=\"http:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/image1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-393 size-full\" src=\"http:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/image1.png\" alt=\"\" width=\"261\" height=\"92\" \/><\/a><br \/>\n2. Type in Automation and click the first icon<br \/>\n<a href=\"http:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/image2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-394 size-full\" src=\"http:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/image2.png\" alt=\"\" width=\"846\" height=\"193\" srcset=\"https:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/image2.png 846w, https:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/image2-300x68.png 300w, https:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/image2-768x175.png 768w\" sizes=\"auto, (max-width: 846px) 100vw, 846px\" \/><\/a><br \/>\n3. After the resource is created select Credentials in Shared Resources on the left pane.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-395 aligncenter\" src=\"http:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/image3.png\" alt=\"\" width=\"207\" height=\"292\" \/><br \/>\n4. Add credentials that have access to table\/cube processing.<br \/>\n5. After saving credentials click Modules in Shared Resources on the left pane.<br \/>\n<a href=\"http:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/image4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-396 size-full\" src=\"http:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/image4.png\" alt=\"\" width=\"208\" height=\"310\" srcset=\"https:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/image4.png 208w, https:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/image4-201x300.png 201w\" sizes=\"auto, (max-width: 208px) 100vw, 208px\" \/><\/a><br \/>\n6. Using Browse gallery install missing modules and update them. The complete list should look like this:<br \/>\n<a href=\"http:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/image5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-397 size-full\" src=\"http:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/image5.png\" alt=\"\" width=\"358\" height=\"628\" srcset=\"https:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/image5.png 358w, https:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/image5-171x300.png 171w\" sizes=\"auto, (max-width: 358px) 100vw, 358px\" \/><\/a><br \/>\n7. Next click Runbooks in Process Automation on the left pane<br \/>\n<a href=\"http:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/image6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-398 size-full\" src=\"http:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/image6.png\" alt=\"\" width=\"203\" height=\"218\" \/><\/a><br \/>\n8. Add new runbook and select its type to PowerShell<br \/>\n<a href=\"http:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/image7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-399 size-full\" src=\"http:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/image7.png\" alt=\"\" width=\"642\" height=\"347\" srcset=\"https:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/image7.png 642w, https:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/image7-300x162.png 300w\" sizes=\"auto, (max-width: 642px) 100vw, 642px\" \/><\/a><br \/>\n9. After creating a runbook, enter it and click Edit and paste this code:<\/p>\n<pre class=\"lang:ps decode:true \" title=\"Powershell script\">## Providing the Server Details\r\n$ServerName = \"asazure:\/\/&lt;region&gt;.asazure.windows.net\/&lt;aas_server_name&gt;\"\r\nDatabaseName = \"&lt;DB_name&gt; \"\r\n$TableName =\"&lt;Table_name&gt;\"\r\n\r\n$AzureCred = Get-AutomationPSCredential -Name '&lt;Your credentials name&gt;'\r\nAdd-AzureRmAccount -Credential $AzureCred | Out-Null\r\nInvoke-ProcessTable -databasename $DatabaseName -server $ServerName -RefreshType \"&lt;Type of processing e.g. Full&gt;\" -Credential $AzureCred -TableName $TableName\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>10. Next \u2013 click Test Pane and Start to see if the script works. If it does, click Publish.<br \/>\n11. Go to https:\/\/flow.microsoft.com\/ , log in, click on My flows and Create from template. Next select PowerApps button:<br \/>\n<a href=\"http:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/image8.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-400 size-full\" src=\"http:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/image8.png\" alt=\"\" width=\"287\" height=\"294\" \/><\/a><br \/>\n12.Enter the flow and add new step. Search for Azure Automation and select Create a job. Fill in the information of the runbook you created in previous steps and save.<br \/>\n<a href=\"http:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/image9.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-401 size-full\" src=\"http:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/image9.png\" alt=\"\" width=\"614\" height=\"275\" srcset=\"https:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/image9.png 614w, https:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/image9-300x134.png 300w\" sizes=\"auto, (max-width: 614px) 100vw, 614px\" \/><\/a><br \/>\n13. Go to PowerApps website and open your PowerApp.<br \/>\n14. In your PowerApp, select Action pane and click Flows.<br \/>\n15. Once a menu opens, select the flow you have created and add it.<br \/>\n16. Select a button to trigger the flow. Edit the OnSelect formula. If it has an action already, you can add another action by using \u201c;;\u201d. Simply type in &lt;YourFlowName&gt;.Run() to insert the trigger.<br \/>\n17. Test the solution.<\/p>\n<p>Let me know, if this approach is clear and if you see any other way.<\/p>\n<p>Thanks<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial was requested by one of our clients. His app was connected to DWH, which was the source for the Analysis Services. After the data was input into the edit form, the task was to start processing the table to see it through Power BI.<\/p>\n<p><a href=\"http:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/artyku\u0142_07.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-404 size-full\" src=\"http:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/artyku\u0142_07.png\" alt=\"\" width=\"1200\" height=\"628\" srcset=\"https:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/artyku\u0142_07.png 1200w, https:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/artyku\u0142_07-300x157.png 300w, https:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/artyku\u0142_07-768x402.png 768w, https:\/\/cwiok.pl\/wp-content\/uploads\/2018\/06\/artyku\u0142_07-1024x536.png 1024w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<div class=\"tech_read_more\"><a href=\"https:\/\/cwiok.pl\/index.php\/en\/2018\/06\/29\/processing-analysis-services-table-in-powerapps\/\">Read More<\/a><\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[],"class_list":["post-391","post","type-post","status-publish","format-standard","hentry","category-azure"],"_links":{"self":[{"href":"https:\/\/cwiok.pl\/index.php\/wp-json\/wp\/v2\/posts\/391","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cwiok.pl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cwiok.pl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cwiok.pl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cwiok.pl\/index.php\/wp-json\/wp\/v2\/comments?post=391"}],"version-history":[{"count":0,"href":"https:\/\/cwiok.pl\/index.php\/wp-json\/wp\/v2\/posts\/391\/revisions"}],"wp:attachment":[{"href":"https:\/\/cwiok.pl\/index.php\/wp-json\/wp\/v2\/media?parent=391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cwiok.pl\/index.php\/wp-json\/wp\/v2\/categories?post=391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cwiok.pl\/index.php\/wp-json\/wp\/v2\/tags?post=391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}