Free cookie consent management tool by TermsFeed

AI Computer Vision Action

On This Page

The AI COMPUTER VISION action takes a screenshot and a prompt that you write, and uses AI to understand what is on the screen. This page describes when to use the action, how to configure it, and how to write prompts that locate elements, check the screen, and extract data.

The AI COMPUTER VISION action uses AI only to understand the screen. Clicks, typing, loops, branching, and error handling stay in the standard low-code actions, so you decide what the robotic task does next. The action works without selectors, so it is useful for applications where selectors are unavailable or unstable, such as websites with changing layouts and remote or Citrix sessions.

When to use AI Computer Vision

Robotic tasks can understand the screen in three ways:

The following table compares the three options:

Option How it finds elements When it fits
Selectors Identifies elements through the application's structure. The application exposes stable selectors.
Locate Image Matches an exact image of pixels. The screen looks exactly the same each time the robotic task runs.
AI Computer Vision Finds elements from a plain-language description of what is on the screen. The layout varies, selectors are unavailable or unstable, or the application runs in a remote session such as Citrix.

Locate, check, and extract with a prompt

You write one prompt for each action. The prompt tells the action what to do with the screenshot.

The following table describes the three kinds of screen understanding that a prompt can request:

Kind What the prompt asks for What the action returns when successful What the action returns when it fails
Locate Find an item on the screen. The position and size of the item. Use the coordinates with the Click and Type text actions. A reason that explains why the action couldn't find the item.
Check Confirm whether an element is on the screen. A found value of true or false. A found value of false, the attempt number, and a reason that explains why the action couldn't find the element.
Extract Read data from the screen. The requested data as a value that you can use later in the robotic task. A reason that explains why the action couldn't read the data.

Add the AI Computer Vision action to a robotic task

To add the AI COMPUTER VISION action to a robotic task:

  1. Drag and drop the AI COMPUTER VISION action from the RPA actions palette into a section or action group.
  2. In the CONFIGURATION area of the ACTION CONFIGURATION pane, configure the parameters.
  3. In the OUTPUTS area of the pane, configure the parameters to store the result.

  4. In the AFTER COMPLETION area of the action pane, configure the following parameters:

    • Wait before executing next action (seconds): Enter the number of seconds the robotic task waits before it continues to the next action in the robotic task definition.
    • Take a screenshot: If you select this option, the robotic task takes a screenshot of the host machine after the action completes. If the action failed, the screenshot is taken immediately before the exception is thrown and cleanup is started. If the action completed successfully, the screenshot is taken immediately after the action is performed.
  5. Click SAVE CHANGES in the page toolbar.

Configuration

In the CONFIGURATION area of the ACTION CONFIGURATION pane, configure the following parameters:

Parameter Required Description
Prompt Yes Describe what the action must locate, check, or extract. See Write effective prompts.
Model No Select the AI model that interprets the screenshot.

Output

The action always returns a map and saves it to the variable that you configure in the OUTPUTS area. Use the status key to find out whether the action achieved the goal in the prompt.

Every map contains the following keys:

Key Type Description
action Text The kind of screen understanding that the prompt requested: LOCATE, CHECK, or EXTRACT.
status Text The outcome of the action: SUCCESS, FAILURE, or ABORT.

The other keys in the map depend on the kind of screen understanding and on the status.

The following example shows the map that a "locate" prompt returns when the action finds the element. The x, y, width, and height keys describe where the element is on the screen:

1
2
3
4
5
6
7
8
9
{
  "action": "LOCATE",
  "status": "SUCCESS",
  "label": "Username",
  "x": 412,
  "y": 286,
  "width": 240,
  "height": 36
}

The following example shows the map that a "check" prompt returns when the action finds the text or appearance that the prompt describes. The attempt key shows which attempt found it:

1
2
3
4
5
6
{
  "action": "CHECK",
  "status": "SUCCESS",
  "found": true,
  "attempt": 2
}

The following example shows the map that an "extract" prompt returns when the action can't read the requested data. The reason key explains why:

1
2
3
4
5
{
  "action": "EXTRACT",
  "status": "FAILURE",
  "reason": "The order status and quantity are not visible on the screen."
}

In the OUTPUTS area of the ACTION CONFIGURATION pane, configure the following parameters to store this result:

  • Operator: Select an option to store the result as a single-value variable (is stored as) or add the result as a multiple-value variable (is appended to).
  • Target: Enter the name of the robotic task variable where you want to store or append the result. If your variable is type CDT, you can specify which field of a CDT to store the result into using dot notation.

Write effective prompts

The prompt is how you choose between locating, checking, and extracting, so a clear prompt matters more than any other setting. Write prompts in plain language, the way you would describe the screen to a colleague.

Follow these guidelines for every prompt:

  • Describe one thing for each action. Use a separate action for each element you need to locate or check.
  • Describe the element so that only one item on the screen matches. Include its label, its role such as button or field, and the part of the screen it is in.
  • Describe what the element looks like or says. Don't describe where it sits in pixel terms, because layouts can change.

Compare strong and weak prompts

Each prompt type has a different focus:

  • A locate prompt names the element to find.
  • A check prompt names the exact text or appearance of the element whose presence you want to confirm.
  • An extract prompt lists the data to read and the name to give each value, which you use later in the robotic task.

The following table shows a strong and a weak prompt for each type:

Prompt type Strength Prompt Why
Locate Strong the username field of the login form Names the element, its role, and the form that contains it.
Locate Weak the field Matches every field on the screen.
Check Strong the message that says "Backup completed" Names the exact text to look for.
Check Weak whether it is finished Doesn't say what on the screen shows that it is finished.
Extract Strong the order status as status and the quantity as quantity Names each value and the label of the data to read.
Extract Weak read the screen Doesn't say which data to return or what to call it.

Usage considerations

Because the AI Computer Vision action is powered by a large language model, results can vary between runs. Check the status value in your robotic task before you act on the screen.

When the action can't achieve the goal in the prompt, it returns a map with a status of FAILURE or ABORT and a reason that explains why.

Screen resolution and display limitations

The AI Computer Vision action:

  • Scales down any screenshot larger than 1.15 megapixels and keeps the aspect ratio. The execution log shows the scale factor.
  • Doesn't support desktop scaling above 100%.
  • Doesn't support multiple displays.

AI Action usage

The AI COMPUTER VISION action consumes AI Actions. AI Actions are the unit of measurement for AI-powered feature usage in Appian.

The number of AI Actions that the action consumes depends on the prompt type and the model that you select:

  • Locate and extract: Each action sends one screenshot in one request to the AI model. The number of AI Actions consumed varies based on the AI model you select.
  • Check: The action checks the screen repeatedly until it finds the element or reaches the timeout. The number of AI Actions consumed varies based on how long it takes the selected AI model to locate the element.

Logging

You can track the number of AI Actions consumed by a robotic task by referring to the AI usage logs, or by using the AI Actions Consumed output in the Execute Robotic Task smart service.

Examples

The following examples each combine the AI COMPUTER VISION action with the standard actions that use its output.

Locate a field on a website with an unfamiliar layout

Use this example when a robotic task signs in to a vendor website whose layout it has not seen before, and no selector is available.

To configure a robotic task so it's capable of locating the username field and entering a value:

  1. Add the AI COMPUTER VISION action.
  2. In the CONFIGURATION area of the action pane, configure the Prompt: enter the username field of the login form.
  3. In the OUTPUTS area of the action pane, store the result in a variable such as usernameLocation.
  4. Add the Click action. Set its position to the x and y values in usernameLocation.
  5. Add the Type text action. Enter the user name.

The same steps work on other sites with different layouts, because the prompt describes the field and not a selector.

Check for a completion message in a remote session

Use this example when a robotic task starts a process in a legacy application that runs in a Citrix session, and the robotic task must know when the process finishes.

To configure a robotic task so it's capable of checking for the message and branching on the result:

  1. Add the AI COMPUTER VISION action.
  2. In the CONFIGURATION area of the action pane, configure the Prompt: enter the message that says "Backup completed".
  3. In the OUTPUTS area of the action pane, store the result in a variable such as backupResult.
  4. Add a conditional or loop that uses the status or found value of backupResult to decide whether to continue or to check the screen again.

Feedback