cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SeanBoltman
Frequent Visitor

"Request approval (everyone must approve) for a selected file" failing on "Create an approval" action - Repeatable in multiple tenants

This is a larger problem because many are hoping to use this flow template to [desperately] replace the exiled SP2010 Approval Workflow. I have worked with the PowerAutomate tech support, and they were able to replicate this problem in their own sandbox.

 

Note:  the "Request approval (first to respond) for a selected file" works fine. This problem here is only with "Request approval (everyone must approve) for a selected file"

 

The problem is this: 

{
  "statusCode"404,
  "message""Resource not found"
}
 
Here is the API information:
{
  "api": {
  },
  "connection": {
    "name""/providers/Microsoft.PowerApps/apis/shared_office365/connections/shared-office365-4a42f0ad-2fd4-47ee-8e16-bb64-b570ccd1"
  }
}
 
You can also see this error show up:
2021-01-06_12-29-21.png
 
I came across an earlier post that mentioned similar failure information as my problem, though its unclear on what the fix was. The suggestion from that person who "solved it" [solution needed more detailed steps!], it was presumed that some of the actions in this flow template are based on earlier versions of the underlying API, though not sure.
 
If anyone else has run into this, and have solved it, please reply here.  My PowerAutomate tech support person is reaching our to the SharePoint Online dev team that creates these flow templates, in hope to get a resolution.
 
Right now my only recourse is to hand-build this same work flow set of actions, from scratch, in hopes that that exercise will bypass this non-sensical error. I see some of you out there have already began that process, and would be interested to hear in your travels.
 
@v-litu-msft :   Can you help us get through this problem?
 
Here is the peek code with that failing "Create an approval" action:
 

{

    "metadata": {

        "flowSystemMetadata": {

            "swaggerOperationId": null

        }

    },

    "inputs": {

        "host": {

            "connection": {

                "name": "@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$connections']['shared_approvals']['connectionId']"

            }

        },

        "method": "post",

        "body": {

            "title": "Please approve: @{body('Get_file_properties')?['{Name}']}",

            "assignedTo": "@{triggerBody()['email']};",

            "details": "The item '@{body('Get_file_properties')?['{Name}']}' is submitted for approval by .\n\nThe message with the request:\n@{if(empty(triggerBody()['text']),'No message included with the request',triggerBody()['text'])}\n\nPlease review, and then approve or reject the request.",

            "itemLink": "@body('Get_file_properties')?['{Link}']",

            "itemLinkDescription": "@body('Get_file_properties')?['{Name}']",

            "enableNotifications": true,

            "enableReassignment": true

        },

        "path": "/types/@{encodeURIComponent('BasicAwaitAll')}",

        "authentication": {

            "type": "Raw",

            "value": "@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$ConnectionKey']"

        }

    }

}

 

Could the problem simply be that the swaggerOperationId value is null?  or perhaps the "BasicAwaitAll" reference has been deprecated?  These are two differences between this action, and it's same counterpart found in the "Request approval (first to respond) for a selected file" which does work properly. The rest of the JSON matches perfectly between the two.

 

 

 

 
 
4 REPLIES 4
BhartenduP
Community Support
Community Support

Hello Sean ,

 

Greetings and thank you for writing to us. I see we are having issues with the "All must approve " step .

I am sorry I am slightly confused by the screenshot I tried however couldn’t get the approvals to show up in the Outlook

 

BhartenduP_0-1610085425692.png

 

 

I wanted to confirm if we are using the office 365 connector or the Approvals step?

 

BhartenduP_1-1610085425693.png

 

 

Please do let me know . If we have not used the start and wait for approval I would request you to check if you are able to reproduce the same issue with the above connector.

 

Please mark my answer as verified if you found it helpful. Please let me know if you have any other questions around the above.

Bhartendu Pandey

Support Engineer - Customer Engagement- Dynamics CRM/PowerApps/Power Automate

Microsoft

SeanBoltman
Frequent Visitor

 

This problem scenario is super simple!  I've included screenshots below to document the entire test from start to finished. Follow these steps, and you can easily replicate the problem. PowerAutomate support tech did it as well on his sandbox tenant.

 

Create a new flow - below you see I choose the flow template named:  "Request approval (everyone must approve) for a selected file".  Note the Connectors that are participating. All looks reasonable.:

 

1.png

 

Again, the below image looks reasonable.

 

2.png

 

 

Now lets manually invoke this new flow: 

 

3.png

 

Filling out the initiation parameters...

 

4.png

 

Instantiation parameters (request description text, plus single user name), now run the flow... Fails! fails quick. No email. Lets go look at what happened:

 

 

5.png

 

Drill down into the failed execution...

 

6.png

 

You see above that the "Create an approval" action fails. ITs telling us "404 Resource not found". This resource is NOT the ItemLink url, as you can grab that url and drop it in another browser page, and it opens the Word document that we are testing this Flow against. This has been tested against different document libraries, different document types, and **different tenants**, the failure is the same!

 

7.png8.png

 

That's all there to replicate this.  Its my understanding that there is a PowerAutomate dev team within the SharePoint Online product development that is responsible for providing the Flow Templates that are intended to be used against SharePoint Online. If so, I hope they look at this and fix this bug.

 

 

 

 

 

 

 

 

 

 

 

SeanBoltman
Frequent Visitor

I solved this problem, fixed this Flow template. 

 

The exercise to solve was open heart surgery.:

  • Create a Zip export of both the successful "Request approval (first to respond) for a selected file" and the failing "Request approval (everyone must approve) for a selected file"
  • Use your favorite comparison program (Compare It!) to modify the failing template's JSON to mimic the successful template's JSON. I had to modify both definitions.json, and lastly, apisMap.json. For definition.json, I was fill in both "null" swaggerOperationIds, plus fixing action API designations (flipping from "approvals" to "office365" url, and visa versa, in order for the api url to match what the successful floe template was using for the same action). Modify definition.js alone did not solve the 404 Resource not found. I had to additionally modify apisMap.json, replacing it wholesale with that used by the successful template's apisMap.json. This final hack fixed the template, and once imported, it tested fine... no more errors.

I can share out the modified/fixed "Request approval (everyone must approve) for a selected file" template zip file for anyone that needs it. Just message me.

 

So that was fun.  But much to my dismay, upon testing this multi-user flow, I discovered it sends out approval requests to all approvers asynchronously.  Which for replacing the SP2010 Approval workflow is not what I want.

 

If there are any of you who have crafted successfully a Flow replacement for the SP2010 Approval Workflow, I would love to hear from you!

ChrizK
Regular Visitor

Great detailed feedback from the community, hopefully Microsoft will respond.

I have literally started looking at flows in the last day or so.  The title of this flow indicates that I can use it as the basis for my requirement (although I want the contents of a list to supply the variables).

 

I haven't got to the point of the failure described, as I do not have the basic understanding how the flow works.

(would be useful if the templates explained how to get them to work).

----------------------------------------------------------------------------------------------------------------

As there hasn't been a response, I am guessing that the community considers it a stupid question.

I have come to the conclusion that Select a file is simply editing the Flow each time you want a file approved.

I didn't consider this, as it isn't how I perceived automation.

If I have got this wrong, please let me know.

 

IMO The title is misleading, as the clever part appears to be the Reminders (requires the choice of Create an Approval, rather than Start and Wait for Approval).  I have come to appreciate that it is simply a parallel branch that effectively runs independently within a timed loop, once the Approval has been created (with a variable to control when it ends, set by the other branch).

 

NB When viewing Templates in Power Automate, I do not believe there is any explanation what each template does (and how).  You select it, and it immediately adds the flow for editing.  I believe It would be helpful if the author could provide some information.

----------------------------------------------------------------------------------------------------------------

>>>> original question, as reference >>>>>>

Would someone mind explaining how a file to be approved is 'selected'?

It implies I can select a file for approval within Sharepoint, by perhaps changing a permission?

I am guessing, by 'selecting' a file, I am prompted to fill in the Request, Approvers, Approval Reminders etc

(items listed in 'For a selected file')

When I open the template, I fill out;

Site Address and Library Name for 'For a Selected File' and 'Get File Properties'

I am prompted "Your flow is ready to go. We recommend you test it", but if I try, 

Manually, this flow cannot be triggered for testing

Automatically, there are not runs for this flow

I think this illustrates a fundamental lack of knowledge on my part.

Could someone explain what I am missing?

 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (4,312)