{"id":600,"date":"2024-02-05T11:34:51","date_gmt":"2024-02-05T11:34:51","guid":{"rendered":"https:\/\/poiseddevelopers.com\/reality-tech\/?p=600"},"modified":"2024-04-26T10:11:24","modified_gmt":"2024-04-26T10:11:24","slug":"creating-logs-for-every-action-in-power-automate","status":"publish","type":"post","link":"https:\/\/poiseddevelopers.com\/reality-tech\/creating-logs-for-every-action-in-power-automate\/","title":{"rendered":"Creating Logs for Every Action in Power Automate"},"content":{"rendered":"<p>The process of \u201ccreating logs for Power Automate instances\u201d involves systematically recording and archiving essential information about each step and action taken during the execution of automated workflows. This comprehensive log becomes an asset, offering users insights into the intricacies of their workflows, enabling efficient troubleshooting, and facilitating performance analysis.<\/p>\n<p>In this blog post, we explore the significance of creating logs for Power Automate instances and how it transforms into a practice for users seeking a deeper understanding of their automated processes. Imagine having a detailed record of when a workflow starts, the events that trigger its execution, the data it processes, and the outcomes it produces\u2014all neatly documented for reference. This level of visibility not only enhances troubleshooting capabilities but also empowers users to optimize and refine their workflows for peak efficiency.<\/p>\n<p><strong>Step: 1\u00a0<\/strong>First Add the \u201cWhen an item is created action and add the Site Address and List Name.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-606\" src=\"https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/IMG-01-2-300x98.webp\" alt=\"img-01\" width=\"300\" height=\"98\" srcset=\"https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/IMG-01-2-300x98.webp 300w, https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/IMG-01-2.webp 668w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Step: 2\u00a0<\/strong>Next, add another Compose action to retrieve the workflow URL. Add the expression for get the URL in SharePoint Online.<\/p>\n<p>We need to concat following string in the compose action<\/p>\n<p>String 1: Environment URL (Region needs to be changed as per tenant configuration)<br role=\"presentation\" data-uw-rm-sr=\"\" \/>https:\/\/asia.flow.microsoft.com\/manage\/environments<\/p>\n<p>String 2: Environment Name<br role=\"presentation\" data-uw-rm-sr=\"\" \/>workflow().tags.environmentName<\/p>\n<p>String 3: \u201cFlows\u201d<\/p>\n<p>String 4:WorkFlow Name<br role=\"presentation\" data-uw-rm-sr=\"\" \/>workflow().name<\/p>\n<p>String 5: \u201cRuns\u201d<\/p>\n<p>String 6: Workflow Run Name:<br role=\"presentation\" data-uw-rm-sr=\"\" \/>workflow().run.name<\/p>\n<div class=\"cons\" style=\"border: 3px solid #000; width: fit-content;\">concat(\u2018https:\/\/asia.flow.microsoft.com\/manage\/environments\/\u2019, workflow().tags.environmentName,\u2019\/flows\/\u2019, workflow().name, \u2018\/runs\/\u2019, workflow().run.name)<\/div>\n<div><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-625 size-full\" src=\"https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/IMG-02-2.webp\" alt=\"img-02\" width=\"914\" height=\"274\" srcset=\"https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/IMG-02-2.webp 914w, https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/IMG-02-2-300x90.webp 300w, https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/IMG-02-2-768x230.webp 768w\" sizes=\"auto, (max-width: 914px) 100vw, 914px\" \/><\/div>\n<div><strong>Step: 3<\/strong>\u00a0Add the \u201cCreate Item\u201d action and include the site name and site URL for when users want to upload logs to the list in SharePoint Online.<\/div>\n<div><strong>Title:<\/strong>\u00a0Include the dynamic \u201cTitle\u201d obtained from the \u201cWhen an item is created\u201d action.<\/div>\n<div><strong>WFItem URL:<\/strong>\u00a0Add the dynamic value \u201cOutput\u201d obtained from the \u201cCompose 2\u201d action.<\/div>\n<div><strong>Stage:<\/strong>\u00a0Here is the manually added \u201cPending by Stage 1.\u201d<\/div>\n<div><strong>Assigned To:<\/strong>\u00a0Enter the Assigned To user email.<\/div>\n<div><strong>Associated List ID:<\/strong>\u00a0Add the dynamic \u201cID\u201d obtained from the \u201cWhen an item is created.\u201d<\/div>\n<div><strong>Status:<\/strong>\u00a0Include the dynamic \u201cStatus Value\u201d obtained from the \u201cWhen an item is created.\u201d<\/div>\n<div><strong>Created By Original Claims:\u00a0<\/strong>Add the dynamic \u201cCreated by Claims\u201d obtained from the \u201cWhen an item is created.\u201d<\/div>\n<div><strong>Modified By Original Claims:\u00a0<\/strong>Add the dynamic \u201cModified by Claims\u201d obtained from the \u201cWhen an item is created.\u201d<\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-631 size-full\" src=\"https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/IMG-03-2.webp\" alt=\"img-03\" width=\"538\" height=\"518\" srcset=\"https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/IMG-03-2.webp 538w, https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/IMG-03-2-300x289.webp 300w\" sizes=\"auto, (max-width: 538px) 100vw, 538px\" \/><\/div>\n<div><\/div>\n<div><strong>Step: 4<\/strong>\u00a0Add the \u201cStart and wait for approval\u201d action.<\/div>\n<div>\n<ul>\n<li>Approval type: Add the approval type which you want to choose in the choice value.<\/li>\n<li>Title: Added the Title<\/li>\n<li>Assigned to: Added the username which you want to send for approval.<\/li>\n<\/ul>\n<\/div>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-633 size-full\" src=\"https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/IMG-04-2.webp\" alt=\"img-04\" width=\"534\" height=\"286\" srcset=\"https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/IMG-04-2.webp 534w, https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/IMG-04-2-300x161.webp 300w\" sizes=\"auto, (max-width: 534px) 100vw, 534px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Step: 5\u00a0<\/strong>Next, include the condition action and add the dynamic \u201cOutcome\u201d obtained from the \u201cStart and Wait for Approval\u201d action. Ensure it is equal to \u201cApprove,\u201d as shown in the screenshot below.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-636 size-full\" src=\"https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/IMG-05-2.webp\" alt=\"img-05\" width=\"537\" height=\"143\" srcset=\"https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/IMG-05-2.webp 537w, https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/IMG-05-2-300x80.webp 300w\" sizes=\"auto, (max-width: 537px) 100vw, 537px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Step: 6\u00a0<\/strong>Again, add the \u201cCreate Item\u201d action in both sides \u201cIf Yes\u201d and \u201cIf No.\u201d<\/p>\n<p><strong>Approve By Display Name:\u00a0<\/strong>Add the dynamic content \u201cResponder display name\u201d obtained from the \u201cStart and Wait for Approval\u201d action. This action is automatically applied in the \u201cApply to each\u201d loop.<\/p>\n<p><strong>Comments:\u00a0<\/strong>Add the dynamic content \u201cResponses Comments\u201d obtained from the \u201cStart and wait for Approval\u201d action.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-641 size-full\" src=\"https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/IMG-06-2.webp\" alt=\"img-06\" width=\"1024\" height=\"696\" srcset=\"https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/IMG-06-2.webp 1024w, https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/IMG-06-2-300x204.webp 300w, https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/IMG-06-2-768x522.webp 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Step: 7\u00a0<\/strong>Create a new entry in the SharePoint list and verify the flow.<\/p>\n<ul>\n<li>Below is a screenshot of the Workflow History list, where we create a log. It displays all the column values that we add in the \u201cCreate Item\u201d action in Power Automate.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-646 size-full\" src=\"https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/IMG-07-2.webp\" alt=\"img-07\" width=\"1024\" height=\"185\" srcset=\"https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/IMG-07-2.webp 1024w, https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/IMG-07-2-300x54.webp 300w, https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/IMG-07-2-768x139.webp 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The process of \u201ccreating logs for Power Automate instances\u201d involves systematically recording and archiving essential information about each step and action taken during the execution of automated workflows. This comprehensive log becomes an asset, offering users insights into the intricacies of their workflows, enabling efficient troubleshooting, and facilitating performance analysis. In this blog post, we [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":603,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[19],"tags":[],"class_list":["post-600","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-power-automate"],"acf":[],"_links":{"self":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/600","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/comments?post=600"}],"version-history":[{"count":8,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/600\/revisions"}],"predecessor-version":[{"id":666,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/600\/revisions\/666"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/media\/603"}],"wp:attachment":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/media?parent=600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/categories?post=600"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/tags?post=600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}