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 Automate / Dynamic dropdowns in a...
Power Automate
Suggested Answer

Dynamic dropdowns in an array - how to reference adjacent field

(1) ShareShare
ReportReport
Posted on by 4
I'm building a custom connector that accepts an array of Country/State objects, where both state and country are dropdowns, and the state is parameterized by the specified country. 
 
In my OpenAPI, I have a LocationList definition that contains the array of Location items.  How can I define the parameter reference for the state field so that it uses the country of the current item in the array?  
 
The documentation for x-ms-dynamic-values and x-ms-dynamic-list describes how to reference other parameters in the request body (like body/country_id), but there doesn't seem to be a way to reference other properties within an array parameter?
 
In other words, how do I express the reference to the country_id parameter in the highlighted text below?
 
    "LocationList": {
      "type": "object",
      "description": "An object that describes the list of locations.",
      "properties": {
        "locations": {
          "type": "array",
          "description": "The list of locations.",
          "x-ms-summary": "Locations",
          "items": {
            "$ref": "#/definitions/Location"
          }
        }
      }
    },
    "Location": {
      "type": "object",
      "description": "An object that describes a location.",
      "required": [
        "country_id",
        "state_id"
      ],
      "properties": {
        "country_id": {
          "type": "string",
          "description": "The country.",
          "x-ms-summary": "country",
          "x-ms-dynamic-values": {
            "operationId": "ListCountries",
            "value-collection": "items",
            "value-path": "id",
            "value-title": "name"
          },
          "x-ms-dynamic-list": {
            "operationId": "ListCountries",
            "itemsPath": "items",
            "itemValuePath": "id",
            "itemTitlePath": "name"
          }
        },
        "state_id": {
          "type": "string",
          "description": "The state within the specified country.",
          "x-ms-summary": "state",
          "x-ms-dynamic-values": {
            "operationId": "LoadStates",
            "value-collection": "items",
            "value-path": "id",
            "value-title": "name",
            "parameters": {
              "country_id": {
                "parameter": "HOW DO I REFERENCE THE COUNTRY_ID PARAMETER HERE?"
              }
            }
          },
          "x-ms-dynamic-list": {
            "operationId": "LoadStates",
            "itemsPath": "items",
            "itemValuePath": "id",
            "itemTitlePath": "name",
            "parameters": {
              "country_id": {
                "parameterReference": "HOW DO I REFERENCE THE COUNTRY_ID PARAMETER HERE?"
              }
            }
          }
        }
      }
    },
Categories:
I have the same question (0)
  • Suggested answer
    trice602 Profile Picture
    15,404 Super User 2025 Season 2 on at
    Hi,
     
    Please try in portion in your code:
     
    "parameters": {
       "country_id": {
          "parameter": "$.country_id" // Reference to country_id
        }
    }
     
     
    ------------------------------------------------


    If this was helpful, please like and/or mark as a verified answer to help others find this too!


    Always glad to help! 💯💯💯💯💯

    Tom 

    Follow me on LinkedIn - Thomas Rice, PMP | LinkedIn

     

     
  • Ben Lambert Profile Picture
    4 on at
    Thanks for the reply Tom, but I don't think that works (I get the standard error "The parameter could not be found in the operation" when trying to update the connector).  I've never seen that $. notation in the OpenAPI for any connector - do you have any docs or examples of that working?
  • trice602 Profile Picture
    15,404 Super User 2025 Season 2 on at
    Hey there!
     
    I am following up on this post dynamic dropdowns in an array - how to reference adjacent field in this category connector development from 10/24/2024.  I know the post is a little older, but it is a common question here so wanted to take a moment and follow-up. I see there have been 2 replies and 1 likes and asking if your question has been answered.  If so, please help the community out by completing one or more of the following actions!  Thanks in advance!
     
    Easy as 1-2-3 ‼️💯⭐😎🆒🙏
     
    1) Mark a reply as a verified answer - this is essential, and it helps others with the same general question find this thread. ✅
    2) You can also mark one of more replies as a verified answer.  Please take a moment and give the author credit for volunteering their time. ✌️
    3) Like one or more replies.  Kudos always greatly appreciated! 👍
     
    Pro tip:  if you found your own solution or workaround, feel free to add a reply to your own post and mark it as the solution too!  The goal is to get this thread marked with a verified answer by anyone that finds one or more replies helpful!
     
    Again, thanks in advance for reading and responding, always glad to help!  Tom 💯💯💯💯💯
  • trice602 Profile Picture
    15,404 Super User 2025 Season 2 on at
    If I can help with anything else please let me know or tag me in a future post, I enjoy reading and answering questions.  Always glad to help!  Tom 💯💯💯💯💯

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard