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

Notifications

Announcements

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 42

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
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard