1

I'm using custom connector and trying to populate dynamic schema response

Using x-ms-dynamic-schema

This is my swagger:

  responses:
    '200':
      description: Result
      schema:
        description: output description
        type: object
        x-ms-dynamic-schema:
          operationId: OperationId
          parameters:
            ref: {parameter: ref}
          value-path: output

And this is the UI dynamic content:

enter image description here

Question is why am I seeing also Body and Item fields while they are not appearing in my schema response:

{
    'output': {
        'type': 'object',
        'properties': {
            'some_field1': {
                'type': 'string',
                'required': True
            },
            'some_field2': {
                'type': 'string',
                'required': True
            },
            'some_field3': {
                'required': True,
                'type': 'array',
                'items': {
                    'type': 'number'
                }
            },
            'some_field4': {
                'required': True,
                'type': 'integer'
            }
        }
    }
}
Ether
  • 53,118
  • 13
  • 86
  • 159
David Meu
  • 1,527
  • 9
  • 14
  • AFAIK, Body and Item are inbuilt objects for any result from previous steps, that are listed under dynamic content . – AjayKumarGhose Jan 17 '22 at 13:40
  • @AjayKumarGhose-MT So ```Body``` is the whole response body? But what ```Item``` refer to? – David Meu Jan 17 '22 at 13:45
  • 1
    Hello @David Meu, Basically When the previous result has more than one object in its entity, it provides a variable as `item` which refers to each entity from result & and `Body` is just whole reference to the result or response from the earlier step, it is json of complete result as it is. – AjayKumarGhose Jan 17 '22 at 13:49
  • This is a bit odd that: ```Body and Item are inbuilt objects``` Because they are not appearing in other connectors responses (Outlook 365 for example) – David Meu Jan 17 '22 at 14:06
  • 1
    Yeah it is inbuilt objects for such connectors which we have created. Even in Outlook 365 for example we can get body in dynamic content as well. – AjayKumarGhose Jan 18 '22 at 11:54
  • Can you please assist me with this thread? https://stackoverflow.com/questions/70767340/azure-custom-connector-working-with-localhost – David Meu Jan 20 '22 at 05:59
  • Sure let me check . Can i post this same as an answer so it will be helpful for other community members for this similar query. – AjayKumarGhose Jan 20 '22 at 06:27
  • 1
    Yes, Would appreciate your assistance. – David Meu Jan 20 '22 at 07:40

1 Answers1

2

Thank you @David Meu, For confirmation. Posting it as an answer to help other community members.

Question is why am I seeing also Body and Item fields while they are not appearing in my schema response:

AFAIK, Body and Item are inbuilt objects for any result from previous steps, that are listed under dynamic content. When the previous result has more than one object in its entity, it provides a variable as item which refers to each entity from result so you can easily refer in looping activities to iterate. and Body is just whole reference to the result or response from the earlier step, it is json of complete result as it is.

Because they are not appearing in other connectors responses (Outlook 365 for example)

We can see the body field (e.g) in Outlook 365 .For activities which have results will only produce that option .so its depends on the activity .

enter image description here

For more information please refer this Microsoft Documentation: Call an API from a Logic Apps workflow using a custom connector & Extend an OpenAPI definition for a custom connector

AjayKumarGhose
  • 4,257
  • 2
  • 4
  • 15