File Extensions


Does anyone have any idea how to auto adjust dynamically file extensions?

I have a bot that will go into SAP and download a bunch of attachments. However, sometimes it might be .TIF, .JPG, .xlsx, .PDF. In the screenshot, the bot renames the files based on the current SAP Document Number (Variable: FileName) that it has open. But I’m looking for ways to dynamically change the file extension. Any ideas?


Hi @neeta.joji ,

You could try using a Get Text Activity and replace everything after the period with the extension you want:



If this is not what you were looking for, then please provide more details so that we may be in a better position to assist you.

Kind Regards
Ashwin A.K


Another solution:

In this case, we can use GetExtension method and GetFileNameWithoutExtension method.

System.IO.Path.GetExtension method returns extension. for example, System.IO.Path.GetExtension("209267517.PDF") returns ".PDF"

System.IO.Path.GetFileNameWithoutExtension method returns filename without extension. for example, System.IO.Path.GetFileNameWithoutExtension("209267517.PDF") returns "209267517"


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.