title: How to set HTTP header in MS Power Automate (Flow) custom connector using policy template
body: <p>I am trying to create a custom connector in MS Flow ( now rebranded to MS Power Automate).  I am trying to add a custom header in my action request using values from the connection, I read the documentation that this is possible using policy template:  <a href="https://docs.microsoft.com/en-us/connectors/custom-connectors/policy-templates/setheader/setheader#input-parameters" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/connectors/custom-connectors/policy-templates/setheader/setheader#input-parameters</a></p>
  
  <p>In the example provided by microsoft here, it's also possible: <a href="https://github.com/microsoft/PowerPlatformConnectors/blob/master/samples/Facebook/apiProperties.json" rel="nofollow noreferrer">https://github.com/microsoft/PowerPlatformConnectors/blob/master/samples/Facebook/apiProperties.json</a></p>
  
  <p>Here is how I set it up in my apiProperties.json.  When the user first make a connection, I ask for their IP, username, and password.  Using the simple authentication type.:</p>
  
  <pre><code>{
    "properties": {
      "capabilities": [],
      "connectionParameters": {
        "ip": {
          "type": "string",
          "uiDefinition": {
            "constraints": {
              "clearText": true,
              "required": "true",
              "tabIndex": 0
            },
            "description": "Your IP",
            "displayName": "IP",
            "tooltip": "Provide your IP"
          }
        },
        "username": {
          "type": "string",
          "uiDefinition": {
            "constraints": {
              "clearText": true,
              "required": "true",
              "tabIndex": 1
            },
            "description": "Your username",
            "displayName": "Username",
            "tooltip": "Provide your username"
          }
        },
        "password": {
          "type": "securestring",
          "uiDefinition": {
            "constraints": {
              "clearText": false,
              "required": "true",
              "tabIndex": 2
            },
            "description": "Your password",
            "displayName": "Password",
            "tooltip": "Provide your password"
          }
        }
      },
      "iconBrandColor": "#ff5c10",
      "policyTemplateInstances": [
        {
          "parameters": {
            "x-ms-apimTemplate-operationName": [
              "MyAction"
            ],
            "x-ms-apimTemplate-policySection": "Request",
            "x-ms-apimTemplateParameter.existsAction": "override",
            "x-ms-apimTemplateParameter.name": "IP",
            "x-ms-apimTemplateParameter.value": "@connectionParameters('ip')"
          },
          "templateId": "setheader",
          "title": "IP"
        }
      ]
    }
  }
  </code></pre>
  
  <p>In the policyTemplateInstances section, you can see that I pass the IP variable as a header parameter.</p>
  
  <p>In the apiDefinitions file, I set the security to be basic:</p>
  
  <pre><code>  "securityDefinitions": {
      "undefined": {
        "type": "basic"
      }
    },
  </code></pre>
  
  <p>So the error I run into is that it actually doesn't pass the control room ip in the action header, what am I doing wrong?</p>