You create an instant flow that retrieves the SharePoint items.
Sometimes, you are getting the HTTP 404 error - "Item Not found." This error stops the flow execution.
You think that the error can come from the "Get item" action when the flow retrieves the non-existing items.
You need to resolve this case without stopping the flow execution.
Please select three steps you should take to mitigate the 404 error.
Click on the arrows to vote for the correct answer
A. B. C. D. E. F.Correct Answers: A, C and E
The HTTP 404 error - "Item not found" is a legitimate case that a programmer needs to capture and resolve.
This error and other Web API's errors, like 500 for unexpected conditions, come from the connectors.
In your flows, you need to mitigate such API's errors without stopping the flow execution.
After the failed node, you add a Switch action.
Then you create the cases for successful execution (HTTP code 200) of the "Get Item" node and for error codes 404 and 500.
Power Automate provides an option "Configure run after" that helps flow to proceed if a node fails.
You can see this option in a menu when you click on the three dots in a node.
By default, this option is set to "is successful" (Number 1)
You need to check "has failed" (Number 2)
This setting tells the flow to run the Switch after the "Get item" action even if the "Get Item" fails.
Then in the Switch node, we need to add a condition.
When “Get item” fails, the action outputs (Number 1) body provides the status code and a message (Number 2).
You provide the code to the Switch as “On” expression: actions('Get_item').outputs.body.status
And then update the Switch cases, including the Case for 404 error.
After you check your flow with the Flow checker and run the Manual Test, you will get the following results for a Successful run (Number 1)
The "Get Item" action failed and produced the 404 code (Number 2)
The Switch node captured the 404 code (Number 3) as an Input and directed the flow to Case 2 - "Equals - 404" (Number 4)
The flow successfully created the missing Item (Number 5) and sent an email notification (Number 6).
All other options are incorrect.
For more information about the troubleshooting of the Web API's errors, please visit the below URLs:
To mitigate the HTTP 404 error in your instant flow and avoid stopping the flow execution, you can take the following three steps:
A. Add a Case for 404 error: When you encounter an HTTP 404 error, it means that the requested item was not found. In this case, you can add a "Case" action to handle the error. This will allow you to continue the flow execution even if the requested item is not found. Inside the case action, you can add steps to perform alternate actions, such as sending an email notification, creating a new item, or updating an existing item.
E. Configure run after options for "Get item": Another way to mitigate the HTTP 404 error is by configuring the "run after" options for the "Get item" action. This will allow you to specify the conditions under which the "Get item" action should run. For example, you can choose to run the action only if the item exists, or if the item does not exist, you can choose to continue the flow execution without running the "Get item" action.
F. Add a new "Get Item" action: If you are frequently encountering the HTTP 404 error, you can add a new "Get Item" action to retrieve the same item. By adding a new "Get Item" action, you can check if the item exists before performing any actions on it. If the item does not exist, you can handle the error using a case action or continue the flow execution without performing any actions.
In summary, to mitigate the HTTP 404 error in your instant flow, you can add a case for the error, configure run after options for the "Get item" action, and add a new "Get Item" action to retrieve the same item. By taking these steps, you can ensure that your flow continues to execute even if the requested item is not found, without interrupting the flow execution.