Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

How to access fields of JSON response object from Swagger API Custom Connector

Like (0) ShareShare
ReportReport
Posted on 23 Apr 2019 08:28:14 by

I have two web apis:   A HTTP GET operation to return a array of objects with Type A. A HTTP POST operation to create object. Type A in used in both request body and response body of this creation operation.

 

It's working well when I set Items of a DataTable control to result of http get call. 

 

I need write some function code for OnSelect property of a button control to do things like: call web api -> check A.id in response field -> make further action. I tried to create a variable using Set() but the variable is boolean type, not A. How can I do above scenario?

Categories:
  • yuqingz Profile Picture
    on 06 May 2019 at 03:12:33
    Re: How to access fields of JSON response object from Swagger API Custom Connector

    anyone know about this?

  • yuqingz Profile Picture
    on 30 Apr 2019 at 08:58:31
    Re: How to access fields of JSON response object from Swagger API Custom Connector

    Below is the Swagger doc of my Web API. I want to call the "post" method and get the "id" field of response to create further action in Powerapps

     

     

    {
    "swagger": "2.0",
    "info": {
    "version": "v1",
    "title": "EXMTestPortal"
    },
    "host": "exmyuqing.azurewebsites.net",
    "schemes": [
    "https"
    ],
    "paths": {
    "/api/Exceptions": {
    "get": {
    "tags": [
    "Exceptions"
    ],
    "operationId": "Exceptions_GetAll",
    "consumes": [],
    "produces": [
    "application/json",
    "text/json",
    "application/xml",
    "text/xml"
    ],
    "parameters": [
    {
    "name": "keyword",
    "in": "query",
    "required": false,
    "type": "string"
    }
    ],
    "responses": {
    "200": {
    "description": "OK",
    "schema": {
    "type": "array",
    "items": {
    "$ref": "#/definitions/Exception"
    }
    }
    }
    }
    },
    "post": {
    "tags": [
    "Exceptions"
    ],
    "operationId": "Exceptions_Post",
    "consumes": [
    "application/json",
    "text/json",
    "application/xml",
    "text/xml",
    "application/x-www-form-urlencoded"
    ],
    "produces": [
    "application/json",
    "text/json",
    "application/xml",
    "text/xml"
    ],
    "parameters": [
    {
    "name": "value",
    "in": "body",
    "required": true,
    "schema": {
    "$ref": "#/definitions/Exception"
    }
    }
    ],
    "responses": {
    "200": {
    "description": "OK",
    "schema": {
    "$ref": "#/definitions/Exception"
    }
    }
    }
    }
    },
    "/api/Exceptions/{id}": {
    "get": {
    "tags": [
    "Exceptions"
    ],
    "operationId": "Exceptions_Get",
    "consumes": [],
    "produces": [
    "application/json",
    "text/json",
    "application/xml",
    "text/xml"
    ],
    "parameters": [
    {
    "name": "id",
    "in": "path",
    "required": true,
    "type": "integer",
    "format": "int32"
    }
    ],
    "responses": {
    "200": {
    "description": "OK",
    "schema": {
    "$ref": "#/definitions/Exception"
    }
    }
    }
    },
    "post": {
    "tags": [
    "Exceptions"
    ],
    "operationId": "Exceptions_Approve",
    "consumes": [],
    "produces": [],
    "parameters": [
    {
    "name": "id",
    "in": "path",
    "required": true,
    "type": "integer",
    "format": "int32"
    },
    {
    "name": "approve",
    "in": "query",
    "required": true,
    "type": "boolean"
    },
    {
    "name": "justification",
    "in": "query",
    "required": true,
    "type": "string"
    }
    ],
    "responses": {
    "204": {
    "description": "No Content"
    }
    }
    }
    }
    },
    "definitions": {
    "Exception": {
    "type": "object",
    "properties": {
    "id": {
    "format": "int32",
    "type": "integer"
    },
    "title": {
    "type": "string"
    },
    "description": {
    "type": "string"
    },
    "status": {
    "type": "string"
    },
    "submitTime": {
    "type": "string"
    },
    "submittedBy": {
    "type": "string"
    },
    "buApprover": {
    "type": "string"
    }
    }
    }
    },
    "securityDefinitions": {
    "oauth2": {
    "type": "oauth2",
    "description": "AAD",
    "flow": "accessCode",
    "authorizationUrl": "https://login.windows.net/common/oauth2/authorize",
    "tokenUrl": "https://login.windows.net/common/oauth2/token",
    "scopes": {}
    }
    }
    }

  • v-monli-msft Profile Picture
    on 24 Apr 2019 at 09:37:33
    Re: How to access fields of JSON response object from Swagger API Custom Connector

    Hi @yuqingz ,

     

    Could you please share the syntax that you already used?

     

    Regards,

    Mona

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,651 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard
Loading started