AS400 - Error Retrieving

Hi,

Im working on a automation that works with As400 terminal, so i need to retrieve numbers when this have error, they appears highlighted like in the image uploaded. I tried using the terminal activity package but no activity worked, (Get color does not work). Someone has this conflict earlier? Any help is preciated. Chears

image

Hi @Rodriguez_Santiago ,

1. Ensure Supported Emulator and Protocol

  • Some emulators (IBM Personal Communications, Attachmate, Micro Focus) can embed color attributes in the data stream. UiPath works best with those when terminal color extraction is needed.
  • Double-check that you’re:
    • Running the UiPath Terminal Session within a supported emulator.
    • Using UiPath’s internal TN5250 connector, or the IBM EHLLAPI interface (if available in your environment), as these may provide better support for color extraction.

2. Get Color at Position Activity: Correct Use

  • The Get Color at Position activity should be:
    • Placed inside the Terminal Session scope.
    • Provided with the exact Row and Column coordinates where the highlighted number appears (both greater than 0).
    • Used after ensuring the screen is loaded (sometimes a Delay activity helps).
  • But even with the correct setup, if your emulator doesn’t expose color info, the activity will throw GetColorError or return nothing.

3. Image-Based OCR as a Reliable Alternative

If color extraction is unsupported by your emulator, image-based automation (screen scraping + OCR) is a reliable workaround:

  • Use UiPath’s “Take Screenshot” or “Get OCR Text” activities to capture a region of the screen where error numbers appear.
  • Use “Google OCR” or “Microsoft OCR” to extract the text, and post-process to retrieve only numbers.
  • If the highlighted color is unique, you can process the screenshot using image activities or color filters to isolate text in that color.

4. Check for Screen Text Markers

  • Sometimes, error numbers are not just colored but also always positioned in the same location or appear after specific keywords.
  • You can use terminal text extraction from specified screen positions and parse out numbers using Regex.

Please try these steps 1 by 1 and let me know if any of them worked for you.

Good day.

@Rodriguez_Santiago

Welcome to the community

When you say get color does not work is it not giving any output? Or giving same for all or is it throwing any error?

Cheers

Hey @Rodriguez_Santiago ,
Yeah, this is a common issue with AS400 automation. The Get Color activity from the terminal package often doesn’t work well because most terminal emulators don’t fully support color detection through UiPath.

A better way to handle this is by using OCR or Computer Vision. Since the error numbers are highlighted, you can try using “Get OCR Text” or “CV Screen Scope” to capture just the area where those numbers show up.

Once you get the text, you can filter out the highlighted/error values using regex or string checks.

It’s not perfect, but way more reliable than depending on terminal activities alone. Let me know if you need help setting up the OCR part.