How to reference a parameter for one dynamic list from another
Hello,
I'm writing a custom connector with a trigger. The trigger uses two parameters with dynamic lists, with one parameter depending on the other. Let's imagine it's a connector to be triggered by new comments to a blog post. First you have to select the blog, and than select the post from that blog.
I've managed to implement this when the parameters are at the root of the body. However, in our backend these must be nested.
Here's the trigger definition:
/api/trigger/subscriptions/BlogCommentPublished:
x-ms-notification-content:
description: Trigger Payload
schema: {$ref: '#/definitions/BlogCommentModel'}
post:
summary: A new comment to a blog post was published
operationId: blog-comment-published
consumes: [application/json]
parameters:
- in: body
name: body
description: Trigger Request Body
schema:
required: [config, filterlist]
type: object
properties:
config:
required: [url, connectorName]
type: object
properties:
url: {title: callback Url,
description: callback Url, type: string, x-ms-notification-url: true, x-ms-visibility: internal}
connectorName: {title: Connector Name, description: Connector Name,
default: BlogPostConnector, type: string, x-ms-visibility: internal}
filterlist:
required: [blogId, postId]
type: object
properties:
blogId:
title: Blog
description: The blog to monitor
type: string
x-ms-dynamic-values:
operationId: load-blogs
value-path: Id
value-title: Name
parameters:
callbackType: syncHttp
connectorName: BlogPostConnector
postId:
title: Tag
description: The post to monitor
type: string
x-ms-dynamic-values:
operationId: load-posts
value-path: Id
value-title: Name
parameters:
callbackType: syncHttp
connectorName: BlogPostConnector
accountId:
parameter: blogId
responses:
'201': {description: Created}
x-ms-trigger: single
You see, the load-posts action requires the blogId. It works when blogId and postId are properties of the root "body" object. However, you see that blogId and postId are properties of filterlist, which in turn is a property of the root object.
I guess that the paremeter reference (accountId: { parameter: blogId } near the end) is wrong, but I tried different ways like
- accountId: { parameter: blogId }
- accountId: { parameterReference: blogId }
- accountId: { parameter: filterlist/blogId }
but I never got it working. What's the proper way to reference one parameter from another in a nested object?