I need to configure the default Approval Flow in SharePoint online, so that it triggers on News Posts but not normal Site Pages.
I can differentiate between the two by checking the item properties for the PromotedState, where 1/2 is News and anything else is a Site Page.
If the PromotedState is 1/2, I proceed with approval as normal. If not, I want to automatically set the approval status as 'approved'.
The problem: When run, the "Approve" Action returns a 502 BadGateway error. The created Site Page is set as 'Pending', but not approved.
{
"error": {
"code": 502,
"source": "flow-apim-europe-002-westeurope-01.azure-apim.net",
"clientRequestId": "0631ab61-71c5-43d1-b314-5e9f4cf3880d",
"message": "BadGateway",
"innerError": {
"status": 500,
"message": "Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))\r\nclientRequestId: 0631ab61-71c5-43d1-b314-5e9f4cf3880d\r\nserviceRequestId: 0631ab61-71c5-43d1-b314-5e9f4cf3880d"
}
}
}
Expected result: A newly created Site Page will be flagged as Approved.
Actual result: A newly created Site Page is flagged as Pending, the Flow fails with a 502 BadGateway error on the Approve action.