Skip to main content
Question

Dheeraj Sudan and Meenu Hinduja- How to convert string variable into file variable?

  • April 17, 2026
  • 2 replies
  • 31 views

mhinduja-DheerajSudan

Hi,

I’m Dheeraj Sudan, a software developer living and working in the United Kingdom. Can anyone share tips How to convert string variable into file variable?

Thanks in Advance!

 

2 replies

Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+6
  • Automation Anywhere Team
  • April 17, 2026

@mhinduja-DheerajSudan Simply, you cannot. What is your use case?


PMosman
Cadet | Tier 2
  • Cadet | Tier 2
  • April 17, 2026

@mhinduja-DheerajSudan As Aaron mentioned, you can’t covert a string variable into a file variable. But if you are asking because you have a file name stored in a string variable and have an action that requires a file variable (for example, extracting text from a PDF) then you can use the File: Assign action.  You will need to choose either Control Room File or Desktop File as the file to be assigned in order to use a string variable.  If you choose the variable option that requires the variable to be a file type variable and it will not let you choose a string variable. 

This is an example of how I have done this.  My string variable has the full path to a pdf file, including filename and extension, which is located on a network drive.