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 Automate / How to implement Other...
Power Automate
Answered

How to implement Other Fields (Key-Value) in Open API json

(1) ShareShare
ReportReport
Posted on by Microsoft Employee
Hello,
 
I wanted to implement a custom connector which will take values dynamically with key value text boxes in the UI (refer below screenshot). 
 
 
I tried to add below properties in the OpenAPI json file but I am getting like below
 
 
 
Below is the sample Json I tried.
 
{
    "swagger": "2.0",
    "info": {
        "title": "Custom Connector",
        "version": "1.0.0"
    },
    "host": "yourhost.com",
    "basePath": "/api",
    "schemes": [
        "https"
    ],
    "consumes": [
        "application/json"
    ],
    "produces": [
        "application/json"
    ],
    "paths": {
        "/createworkitem": {
            "post": {
                "summary": "Create Work Item",
                "operationId": "CreateWorkItem",
                "description": "Create a new work item with optional other fields",
                "parameters": [
                    {
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/CreateWorkItemRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object"
                        }
                    }
                },
                "x-ms-parameters-location": "body"
            }
        }
    },
    "definitions": {
        "CreateWorkItemRequest": {
            "type": "object",
            "properties": {
                "Title": {
                    "type": "string",
                    "description": "Title of the work item"
                },
                "Description": {
                    "type": "string",
                    "description": "Description of the work item"
                },
                "OtherFields": {
                    "type": "array",
                    "description": "Any additional key-value pairs",
                    "additionalProperties": {
                        "type": "string"
                    },
                    "x-ms-visibility": "advanced",
                    "x-ms-summary": "Other Fields"                    
                }
            },
            "required": [
                "Title"
            ]
        }
    }
}
 
Categories:
I have the same question (0)
  • Verified answer
    Sam_Fawzi Profile Picture
    904 Super User 2026 Season 1 on at
    Try to use an object (dictionary), not an array. In Swagger/OpenAPI, dynamic key-value input is modeled with type: object + additionalProperties. Your current OtherFields uses array, and additionalProperties is ignored on arrays.
     
    Fix 
    {
      "swagger": "2.0",
      "info": { "title": "Custom Connector", "version": "1.0.0" },
      "host": "yourhost.com",
      "basePath": "/api",
      "schemes": ["https"],
      "consumes": ["application/json"],
      "produces": ["application/json"],
      "paths": {
        "/createworkitem": {
          "post": {
            "summary": "Create Work Item",
            "operationId": "CreateWorkItem",
            "description": "Create a new work item with optional other fields",
            "parameters": [{
              "name": "body",
              "in": "body",
              "required": true,
              "schema": { "$ref": "#/definitions/CreateWorkItemRequest" }
            }],
            "responses": { "200": { "description": "OK", "schema": { "type": "object" } } },
            "x-ms-parameters-location": "body"
          }
        }
      },
      "definitions": {
        "CreateWorkItemRequest": {
          "type": "object",
          "required": ["Title"],
          "properties": {
            "Title": { "type": "string", "description": "Title of the work item" },
            "Description": { "type": "string", "description": "Description of the work item" },
            "OtherFields": {
              "type": "object",
              "description": "Any additional key-value pairs",
              "additionalProperties": { "type": "string" },
              "x-ms-summary": "Other Fields",
              "x-ms-visibility": "advanced"
            }
          }
        }
      }
    }
     

    This renders in the custom connector designer as an expandable key-value editor where users can add arbitrary keys.
    If your backend expects an array of {key,value} objects
    Model it as:
    "OtherFields": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["key","value"],
        "properties": {
          "key":   { "type": "string" },
          "value": { "type": "string" }
        }
      },
      "x-ms-summary": "Other Fields",
      "x-ms-visibility": "advanced"
    }

    Pick one pattern that matches your API contract:
    Object + additionalProperties -> JSON like "OtherFields": { "Priority":"High", "Owner":"Sam" }
    Array of pairs -> JSON like "OtherFields":[{"key":"Priority","value":"High"}]
  • Suggested answer
    NE-06101621-0 Profile Picture
    Microsoft Employee on at
    Thanks @Sam_Fawzi for sharing your inputs. It is not exactly providing the UI which I am looking for.

    But the suggestion you shared solved my problem. Thanks again.
     
    Array of pairs -> JSON like "OtherFields":[{"key":"Priority","value":"High"}]

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 957

#2
Valantis Profile Picture

Valantis 847

#3
Haque Profile Picture

Haque 609

Last 30 days Overall leaderboard