Hello!
I have created my Custom API Trigger which uses WebHooks. I have added "x-ms-dynamic-schema" to one parameter in my Trigger which allows me to dynamically select options provided by my api.
My subscribe endpoint in swagger looks like this:
"/api/external/WebHook/Subscribe": { "x-ms-notification-content": { "description": "Details for Webhook", "schema": { "type": "object", "properties": { "FormSubmittedData": { "type": "string" }, "User": { "type": "object", "properties": { "UserName": { "type": "string" }, "UserEmail": { "type": "string" } } }, "SubmitDate": { "type": "string" }, "DisplayDataUrl": { "type": "string" }, "FormTitle": { "type": "string" } } } }, "post": { "tags": [ "WebHook" ], "summary": "When form is submitted", "operationId": "webhook-trigger", "consumes": [ "application/json" ], "produces": [ "application/json" ], "responses": { "201": { "description": "Created" } }, "parameters": [ { "name": "Request body of webhook", "in": "body", "description": "This is the request body of the Webhook", "schema": { "type": "object", "properties": { "TriggerUrl": { "type": "string", "x-ms-visibility": "internal", "x-ms-notification-url": true }, "FormUid": { "type": "string", "x-ms-summary": "Select form", "x-ms-dynamic-values": { "operationId": "GetFormSchemas", "parameters": {}, "value-collection": "values", "value-path": "Uid", "value-title": "Title" } } } } } ], "x-ms-trigger": "single" } }
So here comes my question, can I make "schema" property of "x-ms-notification-content" dynamic? I would like to use selected FormUid to get webhook response schema and use it in "x-ms-notification-content" property as schema.
To be honest i want it to work like Typeform trigger does, first you select form which triggers flow and then you can use all field of this form as dynamic values in next action or trigger.
Is it posibble?
I can provide more details if needed
Can you please share the swagger endpoint ? does it can populate x-ms-notification-content dynamically ?
This is a sample custom connector with Webhook trigger. Hope it can help.
Hi,
Hopefully someone can help with this related question.
I can succesfully create and delete the webhook request.
However i dont seem to be able to find where to find how to reference the Microsoft Flow "system" to recieve the api feed which is one of the parameters when creating the webhook.
Any help greatly appreciated.
I am also facing similar issue. Can not make x-ms-dynamic-schema work with trigger. FLOW is not calling my schema endpoint.
can you share your swagger here?
Could you please help me with how you were able to create a custom API webhook trigger for flow?
Thanks
Hello @Anonymous - The docs have been updated here : https://flow.microsoft.com/en-us/documentation/customapi-how-to-swagger/
The doc links to a swagger that actually works so you can test the functionality in real time.
Thanks,
Sunay
Hi @Anonymous -
I am working on posting a tutorial to help with this issue. I will update the thread as soon as the tutorial is live.
Thanks,
Sunay
Hello
I managed to solve my problem by myself. Also i have found a strange bug which occurrs in Typeform trigger too.
I have created two forms in Typeform adn after selecting both of them in trigger dropdown all field from both forms appeared in dynamic content in my action.
Seems like all Json schemas are morged/mixed after fetching from endpoint. I tried to fix that in my trigger but didn't manage to do it so far.
If you want more feedback about flow or more detailed information about this problem just contact me or reply here.
Regards
Hi, thanks for your response.
Yes Itried it like this:
"x-ms-notification-content": { "description": "Details for Webhook", "x-ms-dynamic-schema": { "operationId": "GetSchema", "value-path": "schema" } }
And like this:
"x-ms-notification-content": { "description": "Details for Webhook", "schema": { "x-ms-dynamic-schema": { "operationId": "GetSchema", "value-path": "schema" } } }
In both cases Flow didn't send any request to GetSchema endpoint.
In my opinion both examples are wrong because docuemtntation says "This is a hint to the flow designer that the schema for this parameter (or response) is dynamic in nature.".
So maybe it should be included in response/parameters attributes? But i dont' really know where should I put this.
Regards
WarrenBelz
146,660
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,004
Most Valuable Professional