Skip to content
← All tips

Power Pages Web API: why creating or updating a column fails

The Web API is enabled, the table permissions look fine, and the POST or PATCH still returns an error. The first thing I’d check is whether every column you’re sending is listed in Webapi/<table>/fields.

Sending just one column that isn’t in that site setting is enough to make the whole request fail, not only that column:

Error updating a column that is not allowed

For example, with Webapi/account/fields = description, this fails because address1_city isn’t allowed:

updateRecord("accounts", id, {
  description: "New description",
  address1_city: "Madrid", // not in Webapi/account/fields
});

To fix it, add the column to the setting (description,address1_city) or remove it from the request, then refresh the cache so the change applies.

Lookups have a detail that trips a lot of people up. The request uses primarycontactid@odata.bind, but fields needs the plain logical name of the column, primarycontactid.

Did it help?

If you need help with this in your project, write to me.

More tips