I have a custom API that does GET, POST, PUT and DELETE actions on a single type of items.
This question / bug report is about the PUT function.
I registered the custom connector and it shows the PUT function correctly as in the below screenshot.
As the screenshot shows there are two parameters:
- id
- A record that contains four properties: Title, ToDoID, Priority, Done
If I try to use this function inside PowerApps, it shows me a different signature, as the next three pictures will show.
PowerApp shows it expects two parameters, called "id" and "Title".
After I add the requested Title as in screenshot 3, it becomes clear that a third parameter is expected which is a record.
Screenshot 3: a Record is expected as a third parameter:
The expected contents of the record are shown between the curly braces, as below:
{ ToDoID: number, Priority: number, Done: Boolean }
My question: why is the "Title" property not inside the curly braces?
That would be consistent with the design of the API as well as consistent with the connectors view of the API.
Can I call it a bug?
This PowerApp works though !
I can update the "Title", if I complete the formula as below (screenshot 4).
If you want to reproduce the "problem", see the details below:
The API is here:
http://entocaretodoapi.azurewebsites.net/
It's public at the moment.
It's swagger file is at:
http://entocaretodoapi.azurewebsites.net/swagger/docs/v1
With best regards,
wkaper1
Solved! Go to Solution.
Hi @wkaper1,
I don't think this is a bug, it seems this is related with the Todo definition:
"definitions": { "ToDo": { "required": [ "Title" ], "type": "object", "properties": { "ToDoID": { "format": "int32", "type": "integer" }, "Priority": { "format": "int32", "type": "integer" }, "Title": { "maxLength": 50, "minLength": 0, "type": "string" }, "Done": { "type": "boolean" } } } },
I assume if you remove the "Required " attribute, then the title field should be added into {} under the put method.
Regards,
Michael
Hi @wkaper1,
I don't think this is a bug, it seems this is related with the Todo definition:
"definitions": { "ToDo": { "required": [ "Title" ], "type": "object", "properties": { "ToDoID": { "format": "int32", "type": "integer" }, "Priority": { "format": "int32", "type": "integer" }, "Title": { "maxLength": 50, "minLength": 0, "type": "string" }, "Done": { "type": "boolean" } } } },
I assume if you remove the "Required " attribute, then the title field should be added into {} under the put method.
Regards,
Michael
Hi @v-micsh-msft,
Thanks for your suggestion. I removed the "required" attribute from the ToDo definition as you suggested. Then re-uploaded the file to PowerApps custom connectors. I clicked "update connector".
Then I opened the PowerApp that uses the API and inspected the formula. It still works and does not show me an error. It is still satisfied getting 3 parameters: first the id, then the Title, then a Record that has just three properties (all four, minus Title).
Does the PowerApp still use the old definition of the connector? What should I do to refresh it?
Under the available connections list, delete the old connection of the custom connector, then add a new one.
In PowerApps, under the Add Data Source side, delete the old connection, then click add a new data source, add the corresponding connection there, or you may create a new connection from the Add data source side.
See if this helps.
https://powerapps.microsoft.com/en-us/tutorials/add-data-connection/
Regards,
Michael
The custom connector was already in the right shape.
I opened the PowerApp, deleted the old connection, then added it again.
Indeed it helps!
I see the REST API formula now as expected:
ToDoAPI.ToDoesPut( id, { ...} )
Just an id and a Record as parameters.
And the Title is now part of the Record.
I still do not understand why he did it differently at first, but I guess I need to study the swagger manuals some more!
Thank you for you help!
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
188 | |
56 | |
50 | |
37 | |
36 |
User | Count |
---|---|
270 | |
91 | |
83 | |
76 | |
75 |