web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Trigger a flow from wi...
Power Apps
Unanswered

Trigger a flow from within code (that still works after promoting solution)

(0) ShareShare
ReportReport
Posted on by 44

We'd like to trigger a flow from within a model driven app by using code (JavaScript WebResource).

 

We have used HTTP POST as a trigger for our flow and this works by calling the HTTP POST URL from within our code. But, every time we promote our solution (e.g. from DEV to TEST), our code is broken as the HTTP POST URL of our flow has changed. Is there any other way we can trigger a flow from within code that won't break when promoting solutions? Previously, to manually trigger a Workflow, we could use the WorkflowId that remained consistent between environments.

I have the same question (0)
  • summitb Profile Picture
    2 on at

    You can create a constant.js where urls for each of the env is stored and add a logic that check if the env is dev or prod.

  • EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    Hi @Wauters,

    Unfortunately this isn't supported yet and haven't found a way to preconfigure the POST URLs beforehand when deploying with CDS solutions. It has been a big pain for us to manage through the different environments especially that we have everything automated in Azure DevOps... Here are a couple of workarounds but are more advanced:

    1. Haven't try this yet but hopes this works! Build a PowerShell script that:
      1. runs after your solution import that gets the flow http url with the Flow PowerShell cmdlets
      2. Set the URL in a system configuration entity. If you don't already have one, you can use CDS environment variables
      3. In your JavaScript get the URL by retrieving it from the config entity.
    2. The other method which I used was by leveraging Logic Apps instead of Power Automate where I deployed them with ARM templates and was able to automatically wire up the URLs.
    3. Similar the #1, in your JavaScript reference a configuration entity to retrieve the URL. Manually set the URL in each environment once the flows are deployed in and URLs are known.

     

    I suggest you submit the idea here and I'll vote: https://powerusers.microsoft.com/t5/Power-Apps-Ideas/idb-p/PowerAppsIdeas

    Hope this helps!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 76 Most Valuable Professional

#2
Haque Profile Picture

Haque 69

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard