Common Data Service, Power Platform, PowerApps Portal, Uncategorized, Web API

Power Apps portal Web API: (ERROR)An undeclared property … which only has property annotations in the payload but no property value was found in the payload…

Looking at Web API for portals this weekend. For the scenarios we currently workaround, with the API it’s all easy.

There is a very documentation available which will help you to start:

https://docs.microsoft.com/en-us/powerapps/maker/portals/web-api-perform-operations

and here:

https://docs.microsoft.com/en-us/powerapps/maker/portals/web-api-overview#web-api-operations

When I was trying to bind a related entity on create I was getting the following error:

“An undeclared property … which only has property annotations in the payload but no property value was found in the payload. In OData, only declared navigation properties and declared named streams can be represented as properties without values.”,”innererror”:

The trick is to use a schema name for the attribute not a logical name. My was “tk_Spaceship”(schema name) vs “tk_spaceship”(logical). “tk_Spaceship” it is!

webapi.safeAjax({
    type: "POST",
    url: "/_api/tk_inspections",
    contentType: "application/json",
    data: JSON.stringify({
      "tk_name": "It's a new inspection",
			"tk_type": 821350001,
			"tk_Spaceship@odata.bind":"/tk_equipments(dbc984df-b7e9-ea11-a817-000d3ad20d1d)"
    }),
    success: function (res) {
      alert("Yay!")
    }
  });

1 thought on “Power Apps portal Web API: (ERROR)An undeclared property … which only has property annotations in the payload but no property value was found in the payload…”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s