You can use Get files in folder to get the file. This will result in a list of files stored in %Files%, even if there's only one file to return. So, %Files[0]% will store the first file. You can then use %Files[0].Extension% to get its extension.
-------------------------------------------------------------------------
If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.
I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.