web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Custom connector error...
Power Apps
Unanswered

Custom connector error "JSON parsing error, expected 'object' but got 'string'.",

(0) ShareShare
ReportReport
Posted on by 2,297

I've got a custom connector that calls an Azure Function as Web API.

 

The API is working well, and returning a JSON as response.

 

It seems Power Apps does not like strings as responses, so after a very extensive research, I've updated the function to dump the content as JSON.

 

All I want is to call the web API and get the response in a label.

 

So, I have a button with:

Set(resposta, TesteAPI.httpexample(TextInput1.Text))

 

And a label with:

resposta.body

 

But resposta is empty.

 

And from the monitor, I see that the API is correctly executed:

WebPortal_0-1636317644434.png

 

But the response isn't updated:

WebPortal_1-1636317670838.png

 

This is my API defintion:

swagger: '2.0'
info: {title: TesteAPI, description: '', version: '1.0'}
host: xxx.azurewebsites.net
basePath: /api
schemes: [https]
consumes: [application/json]
produces: [application/json]
paths:
/httpexample:
get:
responses:
default:
description: default
schema:
type: string
properties:
duration: {type: integer, format: int32, description: duration}
size: {type: integer, format: int32, description: size}
status: {type: integer, format: int32, description: status}
headers:
type: string
properties:
Content-Type: {type: string, description: Content-Type}
Date: {type: string, description: Date}
x-ms-apihub-cached-response: {type: boolean, description: x-ms-apihub-cached-response}
description: headers
body: {type: string, description: body, title: '', x-ms-visibility: important}
responseType: {type: string, description: responseType}
x-ms-visibility: important
summary: devolve o nome
description: apenas um exemplo ok
operationId: httpexample
parameters:
- {in: query, name: name, type: string, required: true}
definitions: {}
parameters: {}
responses: {}
securityDefinitions: {}
security: []
tags: []

 

I've tried a million things but nothing works, I've read the whole Azure, Power Apps and Swagger documentation but nothing works. This should be so easy.

 

Can anyone help?

 

Thanks in advance!

Categories:
I have the same question (0)
  • PTBBSolutions Profile Picture
    691 on at

    Hi @WebPortal,

     

    I had a similar issue - still not sure why is it happening.

     

    The way I did it, create a flow which executes you API call on PowerApps button click, and use the flow to return the value for use.


    please let me know if you need further assistance.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard