I have a Power Automate running on an SPO library with content approval enabled. There is an approval workflow and the trigger condition is to start the workflow when the approval status is set to Pending when the file/document is checked in.
I am using the Set Content Approval action to update the status based on the approval outcome.
My workflow also updates some metadata after the approval process, which of course sets the Approval Status to Draft. The workflow updates my file properties, but then will not set the Approval Status because it's in Draft
The workflow fails with this error
"error": {
"code": 502,
"source": "flow-apim-msmanaged-na-northcentralus-01.azure-apim.net",
"clientRequestId": "*********************************",
"message": "BadGateway",
"innerError": {
"status": 500,
"message": "The current state of the item is Draft and the following action Approve cannot be implemented\"\r\nclientRequestId: 763afee4-db00-491f-9e31-f52216c524d1\r\nserviceRequestId: 763afee4-db00-491f-9e31-f52216c524d1"
}
Most of the suggestions posted in support blogs/forums are to include/ add a Set Content Approval Action and set the Status to Submit. In my case, if I do this then the workflow gets triggered again and I end up in a loop.
So was wondering if there is any way to fix this issue using the Send HTTP action to change the status to approved/rejected based on the approval outcome.
This is what I got so far and had no luck

I ended up with this error
The type SP.ListItemEntityCollection does not support HTTP PATCH method.
clientRequestId: **********-b138-4c9b-8052-************
serviceRequestId: *******-5067-c000-6321-**********
If i change the Method to Post i get this error
A type named 'SP.Data.ListnameItems' could not be resolved by the model. When a model is available, each type name must resolve to a valid type.
I am not sure if an doing it right or trying something that is not doable,
Any suggestions on how to get this working.
Thank you,