Skip to main content

Notifications

Community site session details

Community site session details

Session Id : dsAIg2xlZ5079z+ocHcTJZ
Power Automate - Using Connectors
Answered

Custom API WebHook Trigger - dynamic WebHook response schema

Like (0) ShareShare
ReportReport
Posted on 9 Mar 2017 23:43:14 by

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

Categories:
  • thahseen21 Profile Picture
    5 on 13 Nov 2023 at 07:33:43
    Re: Custom API WebHook Trigger - dynamic WebHook response schema

    Can you please share the swagger endpoint ? does it can populate x-ms-notification-content dynamically ?

  • Community Power Platform Member Profile Picture
    on 05 Dec 2019 at 04:36:23
    Re: Custom API WebHook Trigger - dynamic WebHook response schema
    Hello! I am trying to achieve what you have done. Any possible way you could help guide me through it?
  • wuweng Profile Picture
    on 17 Aug 2018 at 15:28:37
    Re: Custom API WebHook Trigger - dynamic WebHook response schema

    This is a sample custom connector with Webhook trigger. Hope it can help.

  • Community Power Platform Member Profile Picture
    on 08 Aug 2018 at 10:20:27
    Re: Custom API WebHook Trigger - dynamic WebHook response schema

    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.

  • pbijvani Profile Picture
    16 on 02 Oct 2017 at 18:26:28
    Re: Custom API WebHook Trigger - dynamic WebHook response schema

    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? 

  • Community Power Platform Member Profile Picture
    on 04 Jul 2017 at 08:13:15
    Re: Custom API WebHook Trigger - dynamic WebHook response schema

     

    Could you please help me with how you were able to create a custom API webhook trigger for flow? 

     

    Thanks

  • Sunay Profile Picture
    on 25 Apr 2017 at 20:33:20
    Re: Custom API WebHook Trigger - dynamic WebHook response schema

    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

  • Sunay Profile Picture
    on 14 Mar 2017 at 19:06:52
    Re: Custom API WebHook Trigger - dynamic WebHook response schema

    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

  • Verified answer
    Community Power Platform Member Profile Picture
    on 14 Mar 2017 at 15:31:44
    Re: Custom API WebHook Trigger - dynamic WebHook response schema

    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.

    flow_bug.png

     

    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

  • Community Power Platform Member Profile Picture
    on 14 Mar 2017 at 08:39:25
    Re: Custom API WebHook Trigger - dynamic WebHook response schema

    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

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,660 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard

Featured topics

Loading started