Webinar

November 3rd, 2021 12:00 PM EDT
Automation for Field Services & DistributionNovember 3rd, 2021 12:00 PM EDT
Learn how creating a digital workforce can improve your supply chain processes!

Robocorp Visual Studio Code Overview

Install the Robocorp Code and Robot Framework Language Server extensions for Visual Studio Code from the Visual Studio Marketplace.

Robocorp Code and Robot Framework Language Server extensions for Visual Studio Code

Robocorp extensions for Visual Studio Code

Creating a new robot

  • Open the Command Palette (macOS: Shift-Command-P, Windows / Linux: Ctrl+Shift+P).
  • Select Robocorp: Create Robot.

Command Palette

Select the Standard template

Select a template

Note that a more extensive Extended template and a pure Python template are also available.

Provide a name for the robot

Provide a name for the robot

Running the robot

You can run the robot in an isolated environment like it would be run in the cloud or self-hosted environments.

The run:

  • Packages the robot just like when uploading to Control Room.
  • Sets up a clean environment and executes the robot, just like the App and Cloud containers do.
  • Displays standard output and the results in the Debug Console panel.

The run gives you a good grasp on if your robot will work outside your computer and if you have everything set up correctly in your robot.yaml and conda.yaml files.

Running using Command Palette

  • Open the Command Palette (macOS: Shift-Command-P, Windows: Ctrl+Shift+P).
  • Select Robocorp: Run Robot.
  • If you have multiple robots in the opened directory, select the one you want to run.

Running using the Activity Bar

  • Click the Robocorp icon in the Activity Bar.
  • Select the robot and the task.
  • Click the launch icon.

Robocorp Activity Bar

Debugging the robot

You can add breakpoints and debug the robot execution.

Important: Disable the Python > Experiments setting. Otherwise, setting the Python path will fail.

  • Open the Command Palette (macOS: Shift-Command-P, Windows: Ctrl+Shift+P).
  • Select Robocorp: Set pythonPath based on robot.yaml.
  • Add a breakpoint in the robot script.

Debugging using the Command Palette

  • Open the Command Palette (macOS: Shift-Command-P, Windows: Ctrl+Shift+P).
  • Select Robocorp: Debug Robot.

Debugging using the Activity Bar

  • Click the Robocorp icon in the Activity Bar.
  • Select the robot and the task.
  • Click the debug icon.

Linking to Control Room

  • Open the Command Palette (macOS: Shift-Command-P, Windows: Ctrl+Shift+P).
  • Select Robocorp: Link to Robocorp Cloud.
  • Press Enter to open Control Room, where you can add new access credentials.
  • Click Add Credential.
  • Provide a name, click Add.
  • Click on the View icon.
  • Click Copy to clipboard.
  • In VS Code, paste the access credential you copied from Control Room.

Unlinking and removing credentials from Control Room

  • Open the Command Palette (macOS: Shift-Command-P, Windows: Ctrl+Shift+P).
  • Select Robocorp: Unlink and remove credentials from Robocorp Cloud.

Uploading the robot to Control Room

  • Open the Command Palette (macOS: Shift-Command-P, Windows: Ctrl+Shift+P).
  • Select Robocorp: Upload Robot to the Robocorp Cloud.
  • Select a workspace.
  • Create a new robot or select an existing robot to overwrite.

Using work items

Key things to know

  • Before jumping into work items, it is worth knowing what we mean by them, so we recommend checking out these:
  • Work items created and used in VsCode are for local development and testing only; they do not affect or transfer to Control Room executions.
  • For development, work items are just folders under devdata:
    • work-items-in: Folder to store your input work items.
    • work-items-out: Folder where the execution places the work item outputs.
      • By default, these should be excluded in .gitignore as outputs are changing and dynamic.
    • work-items.json is a reserved file name used to identify work item structures; you can define multiple work items in it.
      • If your work item uses files, you should place those files into the work item folder.

Usage

  • You can find the Work items -panel in the Robocorp Code sidebar. work-items-panel.png
  • From the panel, you can...
    • Create new work items inputs, which bring in template content to get started.
    • Open work items to view and edit.
    • See the output work items from previous runs > work-items-out.
    • Copying a run output work item as input work item.
    • Delete work items.
  • If the robot contains work items, the execution of the robot will ask you which work item you want to use as input.
    • You can select inputs and previous run outputs for execution: work-item-selection.png

Video instructions

You can also see the whole workflow and follow along in this short video series:

Watch us code a complete robot from scratch in this live-coding video. The robot Google Translates song lyrics from source to target language and saves the original and the translated lyrics as text files:

Changelog

View the Robocorp extension changelog to keep up-to-date with improvements and new features!

September 30, 2021