How to pass pdf names inside a text file as a variable

Does anyone know how to get pdf file names from a textfile and then pass it as a variable? Means under Read PDF text, instead of the file I chose, I can read from the text file the list of pdf file name and pass it as a variable


Hi @joannnn

Welcome to the community!

Can you share more details like putting even the screenshots of your textfile to see the format.

Many thanks.

cheers :smiley:

Happy learning :smiley:


sure Capture2


The above text file is the list of pdf file names I want to pass in as a variable inside read pdf textCapture3

I would want to pass the list of filenames pdf into read pdf text, how should I do it :smile:

1 Like

I’ve attached the screenshots below

1 Like

Hi @joannnn
Welcome to the community :slight_smile:
Do the following steps:

  1. Read the text file
  2. After that perform a regex function on the read text " ^(.*.pdf)$ "
  3. Perform the for loop on the extracted text
  4. Read PDF in the loop.

Hope this helps
Let me know in case of issue.


For the read pdf text, do I input in the extracted text?

The extracted text will be coming in an array, so while you do the for loop you will need to simply put the object name running of the for loop :slight_smile:

1 Like


I have one doubt here. Here, you just specified file names only with any file path.

If you know that file path then you have to pass it along with the file name getting from text file. To read the file names from text file follow the steps mentioned by @Shubham_Varshney

In Read PDF text activity, you have to pass like this.

      "Folder path"+varPDFName

Here, varPDFName refers to the file names in text file.


ReadPdfFiles.xaml (6.1 KB)


Check the attached xaml, it has the functionality as you are expecting.

1 Like

Thank you!

Hello there,

You would Read Text File, then split the content string by end of line using string operations, then you would Read PDF Text in a for each with each of the split values.

Is this what you are looking for?



yup something like that

1 Like