The "Copy File" action would not work here as it does not let you rename the file that you just copied and SharePoint does not expose a direct "Rename File" action.
Perhaps you do have to add a condition, but not the usual kind. You have to check if a file exists in the location or not, but there are no actions that only check for a file and return true or false. You have to add another "Get file content using path" action. But here, if the file does not exist, the action would just fail.
I suggest you wrap that conditional "Get file content using path" in a Scope block. A Scope block is like a try/catch block in Power Automate. You can wrap the conditional "Get file content using path" in it and then configure different scenarios for when it fails and when it succeeds.
Here is how your updated flow should look like:
The first two actions (trigger and the subsequent action) would essentially be the same.
3. Scope: Add a scope block and inside it, add another Get file content using path action. Set the Site Address and for the path, enter the entire path along with the file name i.e., if the file exists in Documents as 123.xlsx, enter: /Documents/@{triggerBody()?['ID']}.xlsx (see the update file screenshot below for an example)
4A. Create file: The action would essentially be the same, just need to update the "Run after" setting. Click on the action, navigate to the Settings tab, and under "Run after" expand the Scope, select "Has failed" and deselect everything else. What this essentially does is configure the action to only run when the Scope block has failed i.e., when an existing file DOES NOT exist.
4B. Update file: Click on the + icon right after the scope and add a parallel branch and add an Update file action. This action will update the existing file with the content of the template, basically clearing all the data to allow new data to be entered. Configure the "Run after" setting for this action by only selecting "Is successful" and deselecting everything else. This tells the flow to run this branch only when the Scope block succeeds i.e., an existing file DOES IN FACT exist.
Site Address and File Identifier: Same as the Get file content using path.
File Content: File content of the template i.e., @{body('Get_file_content_using_path_[Template]')}
You can then add the same Add a row into a table action from the other branch and configure similarlly. Keep in mind, actions in separate branches cannot reference each other. An action can only reference another action in the same branch or the actions that were common before the branch split.
This will create a sort of condition in your flow where it will first check if the file exists, and based on that, it will decide to either create a new file or update the existing file by deleting all the data and entering the data anew.
=====================================================
And I'll say this again, if this reply helped you in any way, please mark 'Yes' for "Was this reply helpful?" and give it a Like 💜 and in case it resolved your issue, please mark it as the Verified Answer ✅. It would be highly appreciated.