Skip to main content

Hi everyone,
I'm trying to extract images from multiple PDFs in a folder using the "PDF → Extract Image" action in Automation Anywhere 360. I'm looping through all PDF files using the "List files in folder" and storing the output in a list variable (pdfList), and then using a For Each loop to extract images from each file.

Even though I've correctly created a list variable (pdfList with subtype Text) and a string variable for the loop item (currentPDF), I keep getting the error:
"Need a variable of type 'List': UNDEFINED".

I tried all the following:

  • Creating a fresh bot and variables manually

  • Ensuring the list is selected from dropdown, not typed

  • Keeping "Use input as output" unchecked

  • Using a separate output folder for extracted images

  • Clearing browser cache, logging out/in again

Despite all this, the same error keeps popping up. I even tried importing a working .bot file and still face the issue.

Has anyone faced this before or found a reliable fix?

It sounds like you’re making this more complex than it needs to be.

Why not:

Loop (through files in a folder), assign $sFilename$ $sExtension$

    Extract PDF Image C:\yourpath\$sFilename$.$sExtension$ to myimage$sFilename$.png

End Loop

It does sound like the List variables are being weird, so let’s avoid using them at all. Thoughts?


You're absolutely right — I was definitely overcomplicating things with the list variables.
Tried your approach using the Loop through files in folder and built the full path using $sFilename$.$sExtension$ — it worked like a charm! 🔥

Appreciate the clean and simple logic — really helped me move forward. 🙏


Reply