<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ghulam Rasool on Medium]]></title>
        <description><![CDATA[Stories by Ghulam Rasool on Medium]]></description>
        <link>https://medium.com/@gr.me.43?source=rss-dc5a70be9ff3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*SgLrpHRMhes2b6x7</url>
            <title>Stories by Ghulam Rasool on Medium</title>
            <link>https://medium.com/@gr.me.43?source=rss-dc5a70be9ff3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 00:52:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gr.me.43/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[ Testing Power Automate Flows with “When an HTTP Request Is Received” (Tenant / Specific Users)]]></title>
            <link>https://medium.com/@gr.me.43/testing-power-automate-flows-with-when-an-http-request-is-received-tenant-specific-users-c9612a21eeec?source=rss-dc5a70be9ff3------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9612a21eeec</guid>
            <dc:creator><![CDATA[Ghulam Rasool]]></dc:creator>
            <pubDate>Tue, 04 Nov 2025 14:48:05 GMT</pubDate>
            <atom:updated>2025-11-04T14:48:05.118Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve ever tried testing a Power Automate flow with the <strong>“When an HTTP request is received”</strong> trigger restricted to <strong>“Only people in my organization”</strong> or specific users, you may have noticed that simple unauthenticated POST requests no longer work.</p><p>This guide walks you through <strong>exactly how to set up and test your flow</strong> using Postman or Insomnia, along with the necessary Azure AD configurations.</p><h3>🔍 Why This Happens</h3><p>When you enable tenant or user restrictions, the flow <strong>requires an authenticated Azure AD token</strong>. Only allowed users within your tenant can trigger it.</p><p>Any attempt to call the endpoint anonymously results in a <strong>401 Unauthorized</strong> error — even if your URL and payload are correct.</p><h3>🧰 What You’ll Need</h3><ul><li>Your flow’s HTTP POST URL (visible in the trigger card after saving)</li><li>A user account allowed to trigger the flow</li><li>Postman or Insomnia collection for testing</li><li>Tenant ID and Client ID for Azure AD authentication</li><li>Azure AD app registration with proper permissions</li><li>Application user in D365 environment</li><li>Service principal as owner or co-owner of the Power Automate flow</li></ul><h3>🧩 Step 1: Register an Application in Azure AD</h3><p>Before authenticating requests, register an app in Azure AD:</p><ol><li>Go to <a href="https://portal.azure.com/">Azure Portal</a> → <strong>Azure Active Directory</strong> → <strong>App registrations</strong> → <strong>New registration</strong></li><li>Name your app (e.g., “Power Automate Flow Tester”) and choose the supported account type</li><li>Click <strong>Register</strong></li><li>Note down:</li></ol><ul><li><strong>Application (client) ID</strong></li><li><strong>Directory (tenant) ID</strong></li><li>Navigate to <strong>Certificates &amp; secrets</strong> → <strong>New client secret</strong> and store it securely (you won’t be able to see it again)</li></ul><h3>🔑 Step 2: Configure API Permissions</h3><p>Grant your app permissions to access Power Automate and other services:</p><ol><li>In the app registration → <strong>API permissions</strong> → <strong>Add a permission</strong></li><li>Common permissions needed:</li></ol><ul><li><strong>Microsoft Graph</strong>: User.Read, email</li><li><strong>Power Automate</strong>: Flow.Read.All, Flow.ReadWrite.All</li><li><strong>Dynamics CRM</strong> (if interacting with Dataverse/D365)</li></ul><p>3. Choose <strong>Delegated</strong> (for actions on behalf of a user) or <strong>Application</strong> (app-only access). For flows restricted to specific users, <strong>Delegated permissions</strong> often work best.</p><p>4. Add the permissions</p><h3>🔐 Step 2.1: Grant Admin Consent</h3><p>Without admin consent, your app cannot use the permissions:</p><ol><li>In <strong>API permissions</strong>, click <strong>Grant admin consent for [Your Tenant]</strong></li><li>Sign in with an admin account if prompted</li><li>Ensure the status changes from <strong>No</strong> → <strong>Yes</strong></li></ol><h3>🏢 Step 3: Add Application User in D365 Environment (Optional)</h3><p>If your flow interacts with Dataverse / Dynamics 365:</p><ol><li>Go to <a href="https://admin.powerplatform.microsoft.com/">Power Platform Admin Center</a></li><li>Select your environment → <strong>Settings</strong> → <strong>Users + permissions</strong> → <strong>Application users</strong></li><li>Click <strong>New app user</strong>, select the Azure AD app, and assign a security role (e.g., System Administrator for testing)</li><li>Click <strong>Create</strong></li></ol><h3>👥 Step 4: Make Service Principal Owner of the Flow</h3><p>Your app needs ownership access to trigger the flow:</p><ol><li>Go to <a href="https://make.powerautomate.com/">Power Automate</a></li><li>Open your flow → click <strong>Owners</strong></li><li>Add your application (service principal) as owner or co-owner</li><li>Save changes</li></ol><h3>🧩 Step 5: Get the Flow Endpoint</h3><p>Open the flow → copy the HTTP POST URL from the trigger.<br> It usually looks like:</p><pre>https://prod-xx.logic.azure.com:443/workflows/&lt;workflow-id&gt;/triggers/manual/paths/invoke?api-version=...</pre><h3>🔑 Step 6: Obtain an Access Token</h3><p>Use Postman or Insomnia:</p><ol><li>Import the <strong>PowerAutomate-HTTPTenantCollection</strong></li><li>Open the “Get Token” request</li><li>Configure OAuth 2.0:</li></ol><ul><li><strong>Auth URL:</strong> https://login.microsoftonline.com/&lt;tenant-id&gt;/oauth2/v2.0/authorize</li><li><strong>Token URL:</strong> https://login.microsoftonline.com/&lt;tenant-id&gt;/oauth2/v2.0/token</li><li><strong>Client ID &amp; Secret:</strong> from your Azure AD app</li><li><strong>Scope:</strong> <a href="https://service.flow.microsoft.com//.default">https://service.flow.microsoft.com//.default</a></li></ul><p>Send the request to get the new access token, and use the token</p><h3>⚙️ Step 7: Call the Flow</h3><ol><li>Open the request named “Call Flow Endpoint”</li><li>Method: <strong>POST</strong></li><li>URL: Your flow HTTP endpoint</li><li>Headers: Authorization: Bearer {{access_token}} (auto-filled 🤔)</li><li>Body: JSON payload as expected by your flow</li><li>Click <strong>Send</strong> → if successful, you’ll see <strong>200 or 202</strong> response</li><li>Check <strong>Flow Run History</strong> → new successful run should appear 🎉</li></ol><h3>🧾 Step 8: Verify and Debug</h3><p>If the flow doesn’t trigger:</p><ul><li>Ensure you’re signed in as an allowed user</li><li>Inspect your token at <a href="https://jwt.ms/">jwt.ms</a> → confirm upn or oid matches</li><li>Verify <strong>admin consent</strong> in Azure AD</li><li>Check application user security roles in D365</li><li>Ensure the service principal is listed as owner</li><li>Note: App-only tokens may fail if the trigger doesn’t allow app identities</li></ul><h3>🧰 Bonus: Scripted Option</h3><p>Automate testing with <strong>Curl</strong> or <strong>PowerShell</strong>:</p><pre>curl -X POST &quot;https://&lt;flow-endpoint&gt;&quot; \<br>  -H &quot;Authorization: Bearer &lt;access_token&gt;&quot; \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{&quot;message&quot;: &quot;hello&quot;}&#39;</pre><pre>$token = Get-MsalToken -ClientId &lt;client-id&gt; -TenantId &lt;tenant-id&gt; -ClientSecret &lt;client-secret&gt; -Scope &quot;https://service.flow.microsoft.com/.default&quot;<br>$headers = @{<br>  &quot;Authorization&quot; = &quot;Bearer $($token.AccessToken)&quot;<br>  &quot;Content-Type&quot; = &quot;application/json&quot;<br>}<br>$body = &#39;{&quot;message&quot;: &quot;hello&quot;}&#39;<br>Invoke-RestMethod -Uri &quot;&lt;flow-endpoint&gt;&quot; -Method Post -Headers $headers -Body $body</pre><h3>✅ Summary</h3><p>Flows restricted to <strong>“Only people in my org / specific users”</strong> require an <strong>Azure AD bearer token</strong>.</p><p><strong>Setup checklist:</strong></p><ol><li>Register an Azure AD app</li><li>Configure API permissions and <strong>grant admin consent</strong></li><li>Add application user in D365 (if applicable)</li><li>Make the service principal an owner of the flow</li><li>Obtain an access token and call the flow</li></ol><p>Once configured, testing with Postman or Insomnia becomes seamless.</p><p>This step-by-step guide simplifies the process for anyone struggling with authenticated HTTP requests in restricted Power Automate flows. Big thanks to the original video that inspired this approach</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9612a21eeec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fixing a “Flow Not Triggering” Issue in Dataverse (CallbackRegistration Trick You Should Know)]]></title>
            <link>https://medium.com/@gr.me.43/fixing-a-flow-not-triggering-issue-in-dataverse-callbackregistration-trick-you-should-know-2af2f02e288b?source=rss-dc5a70be9ff3------2</link>
            <guid isPermaLink="false">https://medium.com/p/2af2f02e288b</guid>
            <category><![CDATA[dataverse]]></category>
            <category><![CDATA[power-automate]]></category>
            <category><![CDATA[dynamics-365]]></category>
            <category><![CDATA[powerplatform]]></category>
            <dc:creator><![CDATA[Ghulam Rasool]]></dc:creator>
            <pubDate>Tue, 04 Nov 2025 12:29:47 GMT</pubDate>
            <atom:updated>2025-11-04T12:44:03.447Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, I ran into one of those frustrating issues that make you question everything you know about Power Automate and Dataverse triggers.</p><p>I had a <strong>flow in a development environment</strong> with a <strong>Dataverse “When a row is added or modified” trigger</strong>. Everything looked perfect — all conditions were met, permissions were fine, and similar flows (on other tables) in the same environment worked flawlessly.</p><p>But for some reason, this one refused to trigger.</p><p>Usually, a quick <strong>turn off → turn on</strong> of the flow refreshes the callback registration behind the scenes — and everything starts working again.<br> But this time… no luck.<br> Even after multiple retries, republishing, and small edits, the trigger simply wouldn’t fire.</p><p>Recreating the flow was an option — but not a smart one.<br> It worked perfectly in <strong>UAT</strong> and <strong>PROD</strong>, and recreating it in DEV would generate a <strong>new workflow ID</strong>, leading to unnecessary redeployments and solution alignment issues.</p><p>So, I opened a <strong>Microsoft support ticket</strong>, and what I learned was worth sharing with the community.</p><h3>🔍 Root Cause: CallbackRegistration Gone Wrong</h3><p>Each Dataverse-triggered flow registers a <strong>callback entry</strong> that connects its <strong>workflow ID</strong> to Dataverse’s event system.</p><p>When this callback registration becomes <strong>mismatched or stale</strong>, the communication link breaks — causing the <strong>Power Automate flow trigger to stop firing</strong>, even though all configurations and conditions appear correct.</p><p>You can check these callback registrations directly in Dataverse via this API call:</p><pre>&lt;your_env_url&gt;/api/data/v9.2/callbackregistrations?$select=name,callbackregistrationid,softdeletestatus</pre><p>This table stores details about all active callbacks, including your <strong>flow’s workflow ID</strong>.</p><h3>🧠 Step 1: Get Your Flow’s Workflow ID</h3><p>You’ll need the <strong>workflow ID</strong> (not the workflow unique ID).<br> Here’s how you can find it:</p><ol><li>Go to your <strong>flow inside the solution</strong>.</li><li>Click on <strong>Solution Layers</strong>.</li><li>Open the <strong>Base Solution layer</strong>.</li><li>Scroll to the bottom — you’ll see the <strong>workflow ID</strong> there.</li></ol><p>Once you have that ID, search for it in the callbackregistrations table, e.g.:</p><pre>https://&lt;your_env&gt;.crm15.dynamics.com/api/data/v9.2/callbackregistrations?$select=name,callbackregistrationid,softdeletestatus</pre><p>Find the record that matches your flow’s workflow ID.</p><h3>🧰 Step 2: Delete the Problematic CallbackRegistration</h3><p>Before proceeding — <strong>turn off the flow</strong>.</p><p>Then, delete the callbackregistration record linked to the workflow ID you found.<br> You can do this in multiple ways — one quick method is directly from the <strong>browser console</strong>:</p><pre>Xrm.WebApi.deleteRecord(&quot;callbackregistration&quot;, &quot;callbackregistrationid&quot;).then(<br>    function success(result) {<br>        console.log(&quot;Callback registration deleted successfully&quot;);<br>    },<br>    function (error) {<br>        console.log(&quot;Error: &quot; + error.message);<br>    }<br>);</pre><p>Make sure to replace &quot;callbackregistrationid&quot; with the actual ID from your query results.</p><h3>🔁 Step 3: Re-Enable the Flow</h3><p>Now, simply <strong>turn your flow back on</strong>.<br> This action will <strong>recreate the callback registration automatically</strong> in Dataverse — with a <strong>fresh new ID</strong> and proper linkage.</p><p>Test your trigger again — it should start working as expected 🎯.</p><h3>💡 Key Takeaways</h3><ul><li>Dataverse-triggered flows rely on hidden <strong>callback registrations</strong> to communicate with the platform.</li><li>If a flow’s trigger randomly stops firing, it could be due to a <strong>stale or broken callback registration</strong>.</li><li>Recreating the callback manually (by deleting the old one) can save hours of troubleshooting and avoid unnecessary redeployments.</li></ul><h3>🙌 Final Thoughts</h3><p>This issue taught me something simple but powerful — sometimes, the problem isn’t with your logic or environment, but with an invisible layer under the hood.</p><p>So next time your flow refuses to trigger, remember to check the <strong>callbackregistration table</strong> — it might just save your day.</p><p>Thanks to Microsoft Support for the insights — and I hope this post helps someone else avoid the same headache!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2af2f02e288b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Efficient Processing of Large Dataverse Datasets Using Power Automate]]></title>
            <link>https://medium.com/@gr.me.43/efficient-processing-of-large-dataverse-datasets-using-power-automate-014cc817602c?source=rss-dc5a70be9ff3------2</link>
            <guid isPermaLink="false">https://medium.com/p/014cc817602c</guid>
            <category><![CDATA[power-automate]]></category>
            <category><![CDATA[power-platform-developers]]></category>
            <category><![CDATA[storage-capacity]]></category>
            <category><![CDATA[dynamics-365]]></category>
            <category><![CDATA[dataverse]]></category>
            <dc:creator><![CDATA[Ghulam Rasool]]></dc:creator>
            <pubDate>Tue, 29 Apr 2025 11:21:14 GMT</pubDate>
            <atom:updated>2025-04-29T11:21:14.615Z</atom:updated>
            <content:encoded><![CDATA[<h3>Overview</h3><p>This document details a robust approach to processing extensive datasets within Microsoft Dataverse using Power Automate. The solution leverages batch requests, change sets or batch parts, pagination with skip tokens, and modular flow design to efficiently update email attachments older than one year, ensuring optimal performance and maintainability.</p><h3>Business Objective</h3><p>To maintain data hygiene and optimize storage, it’s essential to periodically purge or modify outdated email attachments. This solution targets email attachments that are over a year old and not associated with sent emails, updating their content to an empty state.</p><h3>Technical Solution</h3><h3>1. Parent Flow: Orchestrator</h3><p>The parent flow manages the overall process, handling data retrieval, pagination, and invoking child flows for batch processing.</p><h3>Steps:</h3><p><strong>Initialize Variables:</strong></p><ul><li>SkipToken (String): Stores the pagination token for retrieving subsequent records.</li><li>TotalProcessed (Integer): Tracks the total number of records processed.</li><li>Do Until Loop (Condition: SkipToken is empty):</li></ul><p><strong>List Records:</strong></p><p>Entity: activitymimeattachments</p><p>Filter Criteria:</p><ul><li>createdon older than one year</li><li>Associated email status is not ‘Sent’</li></ul><p>Pagination Settings:</p><ul><li>Page Size: 2000</li></ul><p>Skip Token: Use SkipToken variable</p><p><strong>Process Records:</strong></p><ul><li>Invoke Child Flow with first 1000 records</li><li>Invoke Child Flow with remaining 1000 records</li></ul><p><strong>Update SkipToken:</strong></p><ul><li>Extract @odata.nextLink from the response and parse the skiptoken parameter.</li><li>if(empty(outputs(&#39;Get_attachments_from_PROD_environment&#39;)?[&#39;body/@odata.nextLink&#39;]),&#39;&#39;,decodeUriComponent(last(split(decodeUriComponent(outputs(&#39;Get_attachments_from_PROD_environment&#39;)?[&#39;body/@odata.nextLink&#39;]),&#39;skiptoken=&#39;))))</li></ul><p><strong>Increment TotalProcessed:</strong></p><ul><li>Add the number of records processed in this iteration to TotalProcessed.</li></ul><p><strong>Flow Diagram:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*FDkemUzeh3FGIqmcDRHWXA.png" /><figcaption>General (M) Reduce Email Attachment Body Capacity</figcaption></figure><h3>2. Child Flow: Batch Processor</h3><p>The child flow receives a batch of records, constructs a batch request with changesets or batchparts, and sends it to the Dataverse Web API.</p><p><strong>Batch parts</strong> allow grouping multiple operations in a single request for performance, but each executes independently.</p><p><strong>Change sets</strong> are a subset of batch parts where all operations execute transactionally — either all succeed or all fail together.</p><h3>Steps:</h3><ul><li>Recieved Input: JSON string representing an array of activitymimeattachmentid values.</li><li>Parse JSON: Convert the input string into a JSON array.</li></ul><p><strong>Construct Change Sets or Batch Parts</strong></p><p><strong>Select Action:</strong></p><ul><li>Map each activitymimeattachmentid to a change set structure:</li></ul><pre>{<br>  &quot;changeset&quot;: &quot;--changeset_{unique_id}\nContent-Type: application/http\nContent-Transfer-Encoding: binary\n\nPATCH /api/data/v9.2/activitymimeattachments({activitymimeattachmentid}) HTTP/1.1\nContent-Type: application/json; type=entry\n\n{\n  \&quot;body\&quot;: \&quot;\&quot;\n}\n&quot;<br>}</pre><p><strong>Transform to XML:</strong></p><ul><li>Use xpath and xml functions to extract the changeset values.</li><li>Combine all change sets into a single batch request body, ensuring proper formatting.</li></ul><p><strong>Send Batch HTTP Request:</strong></p><ul><li>Method: POST</li><li>URL: <a href="https://{org}.crm.dynamics.com/api/data/v9.2/$batch">https://{org}.crm.dynamics.com/api/data/v9.2/$batch</a></li><li>Headers:Content-Type: multipart/mixed;boundary=batch_{unique_id}</li><li>Body: Constructed batch request with up to 1000 change sets.</li></ul><p><strong>Handle Response:</strong></p><ul><li>Success: If response status is 204 No Content, return status 200.</li><li>Failure: Return status 500 with error details.</li></ul><p><strong>Flow Diagram:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*ZeeEHFmi8oz1D-MZ84TDwg.png" /><figcaption>General (M) Clear email attachment body</figcaption></figure><h3>Key Considerations</h3><p><strong>Batch Size Limitations:</strong></p><ul><li>Each batch request can contain up to 1000 individual requests.</li></ul><p><strong>Pagination Handling:</strong></p><ul><li>Utilize the @odata.nextLink property to manage pagination effectively.</li></ul><p><strong>Error Handling:</strong></p><ul><li>Implement robust error handling to capture and log any failures during batch processing.</li></ul><h3>Conclusion</h3><p>By implementing this modular and efficient approach, organizations can maintain data hygiene in Dataverse by processing large datasets effectively. The use of batch requests, change sets, and pagination ensures optimal performance and scalability.</p><p>Note: Ensure that all necessary permissions are in place for the flows to access and modify the required Dataverse records.</p><h3>References</h3><ul><li><a href="https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/execute-batch-operations-using-web-api">Execute batch operations using the Web API</a></li><li><a href="https://learn.microsoft.com/en-us/power-automate/dataverse/change-set">Use a flow to perform a changeset request in Dataverse</a></li><li><a href="https://learn.microsoft.com/en-us/power-apps/developer/data-platform/optimize-performance-create-update">Optimize performance for bulk operations</a></li><li><a href="https://learn.microsoft.com/en-us/power-apps/developer/data-platform/bulk-operations">Use bulk operation messages</a></li><li><a href="https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/query/page-results">Page results using OData</a></li><li><a href="https://learn.microsoft.com/en-us/power-apps/maker/data-platform/api-limits-overview">Microsoft Dataverse API limits overview</a></li><li><a href="https://learn.microsoft.com/en-us/power-automate/guidance/coding-guidelines/understand-limits">Understand platform limits and avoid throttling</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=014cc817602c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>