{"id":1534,"date":"2025-04-29T08:10:00","date_gmt":"2025-04-29T13:10:00","guid":{"rendered":"https:\/\/automatethemundane.com\/index.php\/2025\/04\/29\/auto-timeline-post-in-model-driven-app-for-power-platform\/"},"modified":"2025-04-29T08:10:00","modified_gmt":"2025-04-29T13:10:00","slug":"auto-timeline-post-in-model-driven-app-for-power-platform","status":"publish","type":"post","link":"https:\/\/automatethemundane.com\/index.php\/2025\/04\/29\/auto-timeline-post-in-model-driven-app-for-power-platform\/","title":{"rendered":"Auto Timeline post in Model Driven app for Power Platform"},"content":{"rendered":"\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">In Dynamics 365 there is a great feature to allow for auto posting of updates to a record when it is updated. In Power Platform this feature doesn&#039;t exist, that doesn&#039;t mean thought that we can not build it ourselves. In this post I will go over how to build a Power Automate flow that will auto post on the timeline when any user makes an update to the data. <\/p>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">&nbsp;<\/p>\n\n\n<h1 class=\"wp-block-heading\">Auditing <\/h1>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">The first step in this is to ensure that auditing is enabled within the environments we are working in. We need auditing because we need to get the previous value of the data after the user makes the update. <\/p>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">From the PPAC, ensure auditing is enabled on any developer and downstream environments. For this example I left \u201cRetain Audit logs forever\u201d, you may want to change this for developer and test environments. <\/p>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">&nbsp;<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2025\/04\/image-27.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">&nbsp;<\/p>\n\n\n<h1 class=\"wp-block-heading\">Sample App<\/h1>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">The Model Driven app I have has a single table and a single Business Process Flow in it. <\/p>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">&nbsp;<\/p>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">The table is called Timeline Demo. It has four columns in addition to the primary name column. <\/p>\n\n\n<ol class=\"wp-block-list\">\n<li>Demo Choice<\/li>\n\n\n\n<li>Demo Boolean<\/li>\n\n\n\n<li>Demo Text<\/li>\n\n\n\n<li>Demo Whole Number<\/li>\n<\/ol>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">The table has attachments and notes enabled (this turns on the timeline control) and auditing turned on.<\/p>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">&nbsp;<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2025\/04\/image-28.png\" alt=\"\"\/><\/figure>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2025\/04\/image-29.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">&nbsp;<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2025\/04\/image-30-1024x453.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">&nbsp;<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2025\/04\/image-31-1024x464.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">&nbsp;<\/p>\n\n\n<h1 class=\"wp-block-heading\">Flow<\/h1>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">With the table and app configured, a power automate flow is used to create the note.<\/p>\n\n\n<ol class=\"wp-block-list\">\n<li>The trigger will be when the record is modified \n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2025\/04\/image-32-1024x450.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>The first action will be to list all rows in the audits table and filter it by the GUID of the Timeline Demo table and the action is \u201cUpdate\u201d (2)\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2025\/04\/image-33-1024x404.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-background\" style=\"background-color: rgb(241, 241, 239)\">&#x1f4a1; For a full list of the change codes please use this URL <a href=\"https:\/\/learn.microsoft.com\/en-us\/power-apps\/developer\/data-platform\/reference\/entities\/audit#BKMK_Action\">Auditing (Audit) table\/entity reference (Microsoft Dataverse) - Power Apps | Microsoft Learn<\/a><\/p>\n<\/li>\n\n\n\n<li>A Parse JSON is then used to extract the values\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2025\/04\/image-34-1024x403.png\" alt=\"\"\/><\/figure>\n\n\n<pre class=\"wp-block-code\"><code>outputs(&#039;List_rows_-_Audit_Table&#039;)?[&#039;body\/value&#039;]?[0]?[&#039;changedata&#039;]<\/code><\/pre>\n\n\n<p>&nbsp;<\/p>\n<\/li>\n\n\n\n<li>Next lookup the user who updated the record by using the modified by value\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2025\/04\/image-35-1024x434.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>Initialize a string variable to keep the updates in a single record\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2025\/04\/image-36-1024x207.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>Within a loop do an HTTP call to get the display name of the columns that were updated\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2025\/04\/image-37-1024x249.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>Add compose to create the update notes \n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2025\/04\/image-38-1024x173.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>Add an append to string variable to collect the updates\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2025\/04\/image-39-1024x248.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>Finally add a new record to the notes table  \n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2025\/04\/image-40-1024x493.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>With that in place it will now create the note.\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2025\/04\/image-41-1024x337.png\" alt=\"\"\/><\/figure>\n<\/li>\n<\/ol>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">The next step is to update it with a service account and add BPF to the notes. This flow can also be updated to be a child flow so it can be used over and over. <\/p>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">&nbsp;<\/p>\n\n\n<h1 class=\"wp-block-heading\">App Registration<\/h1>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">There are a lot of guides on how to create an app registration out there. For this I will keep it simple for what I did. <\/p>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">In Azure I created an app registration with the Dynamics CRM user_impresonation Delegated permission. <\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2025\/04\/image-42-1024x220.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">Within PPAC I made a security role that has CRW to the Notes table and Append and Append to on the Demo table. Then I added the role to the app registration. <\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2025\/04\/image-43-500x1024.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">With the registration done I can now make a new connection using a service principal and let it create the notes for me. <\/p>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">&nbsp;<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2025\/04\/image-44-1024x285.png\" alt=\"\"\/><\/figure>\n\n\n<h1 class=\"wp-block-heading\">Adding the BPF Updates to the timeline<\/h1>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">The last part is to add any updates to the BPF to the timeline. To demonstrate this I created a simple 3 step BPF called Timeline Demo Process<\/p>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">&nbsp;<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2025\/04\/image-45.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">&nbsp;<\/p>\n\n\n<ol class=\"wp-block-list\">\n<li>The trigger is when the BPF is updated\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2025\/04\/image-46-1024x204.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>An initialize variable is added to hold the note\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2025\/04\/image-47-1024x275.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>A get row by ID from the user table is added using the modified by value\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2025\/04\/image-48-1024x351.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>Another get row by ID is used to get the active stage name using the Active Stage ID\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2025\/04\/image-49-1024x418.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n\n<li>A condition is added based on the status of the BPF. \n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2025\/04\/image-50-1024x518.png\" alt=\"\"\/><\/figure>\n\n\n<ol class=\"wp-block-list\">\n<li>If it is active it will create the following note\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2025\/04\/image-51.png\" alt=\"\"\/><\/figure>\n<\/li>\n\n\n<li>If the BPF is inactive (Closed) it will create this note\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2025\/04\/image-52.png\" alt=\"\"\/><\/figure>\n<\/li>\n<\/ol>\n<\/li>\n\n\n\n<li>Then a row is added to the notes table using the App registration the same as above\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2025\/04\/image-53.png\" alt=\"\"\/><\/figure>\n<\/li>\n<\/ol>\n\n","protected":false},"excerpt":{"rendered":"<p>In Dynamics 365 there is a great feature to allow for auto posting of updates to a record when it is updated. In Power Platform this feature doesn&#039;t exist, that doesn&#039;t mean thought that we can not build it ourselves. In this post I will go over how to build a Power Automate flow that [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1535,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,6,30],"tags":[32],"class_list":["post-1534","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dataverse","category-model-driven-app","category-power-automate","tag-testing","entry","has-media"],"jetpack_featured_media_url":"https:\/\/automatethemundane.com\/wp-content\/uploads\/2025\/04\/photo-1602629978851-125a3b62f3d8-scaled.jpg","_links":{"self":[{"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/posts\/1534","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/comments?post=1534"}],"version-history":[{"count":0,"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/posts\/1534\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/media\/1535"}],"wp:attachment":[{"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/media?parent=1534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/categories?post=1534"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/tags?post=1534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}