Hello,
1) I have created a function app in Azure to return a value and it works fine.
return func.HttpResponse(f'Func = {str(Func)}', status_code=200).
2) In PowerApps, I have created the connector and it also works fine (see attached).
3) However,when I use my function in my app in the "onselect" button i receive an error:
a) The function I have used is: UpdateContext({varoutput:MyFunction.Connector(TextInput1,TextInput2)})
b) The error I had is: "The data returned in the response is invalid. Response data should be a valid JSON object.
4) When going to Monitor Experimental in PowerApps, I see no errors and the result is shown in "response".
5) This is the swagger file:
swagger: '2.0'
info: {version: 1.0.0, title: MyFunction}
host: xxx.xxx.xxx
basePath: /
schemes: [https]
consumes: []
produces: []
paths:
/xxx/xxx:
post:
description: Calls function over https
operationId: xxxx
parameters:
- name: body
in: body
required: true
schema:
type: object
properties:
year: {type: integer, format: int32, description: year, title: year}
month: {type: integer, format: int32, description: month, title: month}
required: [month, year]
responses:
'200':
description: Successful response
schema: {title: The response of the api., type: string}
default:
description: default
schema: {type: string}
summary: Summary
definitions: {}
parameters: {}
responses: {}
securityDefinitions:
API Key: {type: apiKey, in: header, name: Key}
security:
- API Key: []
tags: []
Thank you,
BR