So I have the following part of a flow:

I want to retrieve the most recently added file in a specific folder, as shown by the first three tools. The files will always have the same name except for being ordered at the start and including the date of upload (so 1. [filename][date], 2. [filename][date] etc).
This is what my dynamic input looks like:

The file name comes after the very last '\'. I was told in several tutorials and videos to include a template file? I was not sure what this was, so I just used the current most recent file in the folder. Before, I was facing no issues when running this flow. A few days later I got the read only error.
Any ideas on what to do? Thanks.