Skip to main content

Notifications

Community site session details

Community site session details

Session Id : mnCFFqSh32AsOVLH2o1aCM
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 Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 177 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 99

#3
stampcoin Profile Picture

stampcoin 80

Overall leaderboard
Loading started