@Anonymous :
Here is an example that should help you.
In my example, I am assuming that the only files that go into the library are the ones that you want to process. If that is not the case, you'll need to do some filtering or use a condition.
I have two expressions. First, I have an expression that strips the date part out of the file name when I initialize the variable:
substring(triggerBody()?['{FilenameWithExtension}'],0,indexOf(triggerBody()?['{FilenameWithExtension}'],'-'))
Please note that I selected Filename with Extension from Dynamic properties when creating the expression.
When creating the file, I use the following expression to add the extension to the file name stored in my variable:
concat(variables('varFileName'),'.xlsx')

If this addresses your issue, please mark you post as Solved.
If you like my solution, please give it a Thumbs Up.
Scott