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 / Set Host URL policy te...
Power Apps
Suggested Answer

Set Host URL policy template not replacing the request URL

(1) ShareShare
ReportReport
Posted on by 280
I am passing host url dynamically to custom connector action using Set Host URL policy template but not working. I used headers('containername') in the policy template but I'm getting error that the containername was not sent in headers.
Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,974 Moderator on at
     
    To quote my 2nd grade teacher lol, "show your work", at least I am pretty sure she said that.. that or, don't bring peanuts to class anymore, probably that too :-)
     
    But in all seriousness, please share your work, versus just sort of explaining it and mentioning an error, that is also not shared.
     
    Cheers and good luck!!
  • CU21030433-0 Profile Picture
    10 on at
    Since OP hasn't responded yet and I am getting the same error while trying to use Set host URL policy, I'll share what I have:
     
    1. A header parameter called "new_url" in the Action Definition
    2. A Set host URL policy applied to all actions that sets the URL from that parameter
    3. Populating the parameter in my flow prior for the action
     
    The error I get when I Test (similar error when I try to use query parameter as well):
     
    {
      "error": {
        "code": 500,
        "message": "Property with name new_url is not present in headers.",
        "source": "unitedstates-002.azure-apim.net",
        "path": "",
        "policyId": "",
        "clientRequestId": "",
        "dreeSet": "true"
      }
    }
     
    When I try to use it in a flow, it simply hangs and times out.
     
     
  • CU21030433-0 Profile Picture
    10 on at
    Oops, accidentally posted trying to upload some screenshots to my previous post. Hope this helps. 
    Screenshot 2025-0...
    Screenshot 2025-0...

    Your file is currently under scan for potential threats. Please wait while we review it for any viruses or malicious content.

  • BANDOVS Profile Picture
    4 on at
    I am having this same problem. The strange thing is that the policy is working on old connectors but if I try to create a new one I get the "[variable] is not present in headers error". I'm pretty sure this is a bug.
     
    After messing around with this for a while I found that changing the policy from using the headers('[variable]') to queryParameters('[variable]') works.
     
    (And also updating the header variable to a query variable in the Swagger editor.)
     
    Whilst this is an effective workaround it's a pain because I use these connectors on all new environments and don't want to have to manually update the policy and variable type in each one. I know I could do this at source, but I'm not sure how this effects existing flows that use the connector.
  • CU21030433-0 Profile Picture
    10 on at
    Thanks for sharing your experience. Unfortunately, I get the same "not found" error using the query parameters as well!
  • Suggested answer
    GV-22041444-0 Profile Picture
    2 on at
    we did encounter the same issue.. not sure why this happened, it was working before. Now we changed from headers to queryParameters and it started to work. 

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard