Skip to main content
Solved

PDF Extract Image — "Need a variable of type List: UNDEFINED" error


Forum|alt.badge.img+1

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?

Best answer by Aaron.Gleason

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?

View original
Did this topic help answer your question?

2 replies

Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+10
  • Automation Anywhere Team
  • 559 replies
  • Answer
  • April 6, 2025

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?


Forum|alt.badge.img+1
  • Author
  • Cadet | Tier 2
  • 2 replies
  • April 6, 2025

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. 🙏


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings