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 / Dynamic schema in cust...
Power Apps
Answered

Dynamic schema in custom connector

(0) ShareShare
ReportReport
Posted on by 4

I've created a custom connector which I initially only used in Power Automate. This custom connector uses dynamic schemas to determine the result object based on the input parameters. This is done in the swagger definition of the custom connector as described here https://docs.microsoft.com/en-us/connectors/custom-connectors/openapi-extensions#use-dynamic-values

 

This works fine in Power Automate. When I select some input data I can see a call in the network tab in developer tools in the browser, and i'm able to use my schema in the next steps in my flow.

 

However, when I use this same connector in PowerApps, I never get a result object. I'm unable to select any fields or use anything of the result of my calls. When I put the output directly in a variable or collection, I see something is in there, but i'm not able to use it. It doesn't have any named fields.

When I monitor this using developer tools in my browser, I see the actual data call with data returned. But never a schema call.

 

My question is, is dynamic schemas supported in PowerApps for a custom connector? And if so, is there anything specific I need to do to make this work?

Categories:
I have the same question (0)
  • Verified answer
    v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @joerio ,

    Yes, this is not supported in powerapps.

    X-ms-dynamic-schema  is a kind of OpenAPI extension only supported for Logic Apps and Power Automate.

    Here's a doc about the OpenAPI extensions that only supported for Logic Apps and Power Automate in details for your reference:

    https://docs.microsoft.com/en-us/connectors/custom-connectors/openapi-extensions#x-ms-url-encoding

    In powerapps, you could only provide an OpenAPI definition file without  including those OpenAPI extensions to create custom connectors.

    Here's a doc about this solution for your reference:

    https://docs.microsoft.com/en-us/connectors/custom-connectors/define-openapi-definition

     

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I also having issues with creating a dynamic schema based on my dynamic values.
    Note that I need both params x-ms-dynamic-values and x-ms-dynamic-schema to be in my body request eventually.
    (dynamic values are working as expected)
    Can someone please assist?
    This is my swagger (openapi 2.0):

     

     

     

     

    paths:
     /api/v1/actions:
     get:
     description: Get lists
     summary: Get's action list you have access to
     operationId: GetActionsList
     parameters:
     - {in: query, name: include_attributes, default: ref, type: string, description: The
     number of items to skip before starting to collect the result set}
     responses:
     '200':
     description: OK
     schema: {$ref: '#/definitions/GetLists'}
     /api/v1/executions:
     post:
     description: Executing ST action - Uses Dynamic values and dynamic schema to
     draw form
     summary: Executing ST action
     operationId: ExecuteSTAction
     parameters:
     - in: body
     name: actionreq
     description: Action request execution.
     schema: {$ref: '#/definitions/ActionReq'}
     responses:
     '201': {description: Executed}
     /api/v1/actions/{actionId}:
     get:
     description: Gets the schema of the selected action
     summary: Get's the schema of the selected action
     operationId: GetActionSchema
     parameters:
     - {name: actionId, in: path, required: true, type: string, x-ms-summary: Select
     Action}
     responses:
     '200':
     description: OK
     schema: {type: object}
    definitions:
     GetLists:
     type: array
     items:
     type: object
     properties:
     ref: {type: string}
     required: [ref]
     ActionReq:
     type: object
     properties:
     action:
     type: string
     description: ST action
     title: Select Action
     x-ms-summary: Select Action
     x-ms-dynamic-values: {operationId: GetActionsList, value-path: ref}
     x-ms-visibility: important
     actionschema:
     description: Dynamic Schema of items in selected action
     type: object
     x-ms-dynamic-schema:
     operationId: GetActionSchema
     parameters:
     actionId: {parameter: action}
     value-path: body/parameters
     required: [action, actionschema]
    security:
    - API Key: []

     

     

    After selecting a value from the dynamic values no schema gets populated:

    DavidMeu_0-1638710457194.png

     

     



    But my dynamic schema doesn't seems to work + my endpoint doesn't recognize actionschema as a body param in the custom connector UI.

  • markf Profile Picture
    9 on at

    Could someone say a little more about this please?


    I understand from the accepted solution that at the time of writing parameters could not be passed from a canvas app to a custom connector whereas they could from a Power Automate flow. Is that correct? If so, is it still the case?

     

    If it is still the case, is there any workaround? I looked at the references about dynamic schemas but wasn't able to tell.

     

    From what I see in the canvas app it looks like it should work:

     

    I am using a custom connector (which works in Power Automate) to populate a collection in my app.

     

    When I enter the connector function in the function bar I see prompts for its dynamic values and when I bind the collection to a control the expected field names appear.

     

    When I inspect the monitor output after running the call it looks like the correct parameters are passed in the http request but an error is returned by the API I am calling.

     

    I'd be very grateful if anyone has advice on this.

  • markf Profile Picture
    9 on at

    Ah, please ignore my previous post. I realise that the problem I have is not to do with dynamic schema

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard