On an instant flow I added a File input and named it PDF File (we only use PDFs but the code explained below will dynamically grab any extension of a file uploaded)

Next I created a compose action and entered the following dynamic content I want

I could not select the file name item in the available list of dynamic items for some reason so I had to type it out (The below code should work though if copy/pasted)


Next I created a variable action with the type as Array and split the array at the period (.)

Here is the expression:

@{split(outputs('Compose_FileName'), '.')}

The final part is to then grab the last item in the array which will be the file extensions (example: pdf)

Here is the code:


Now you can use the output of the above compose action to use when creating a file

Be sure to include the period (.) because the split will strip it out (See File Name Example below)

I have not tried it but the method should work for multiple file inputs however you would need to create a variable and compose action for each item