Add Work Item File
Add given file to work item.
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
path | null | ||
name | None |
param path: | Path to file on disk |
---|---|
param name: | Destination name for file. If not given, current name of local file is used. |
NOTE: Files are not uploaded before work item is saved
Examples
*** Tasks ***
Add work item file output.xls
Save work item
Add Work Item Files
Add all files that match given pattern to work item.
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
pattern | null |
param pattern: | Path wildcard pattern |
---|
Examples
*** Tasks ***
Add work item files %{ROBOT_ROOT}/generated/*.csv
Save work item
Clear Work Item
Remove all data in the current work item.
Examples
*** Tasks ***
Clear work item
Save work item
Delete Work Item Variables
Delete variable(s) from the current work item.
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
names | null | ||
force | True |
param names: | Names of variables to remove |
---|---|
param force: | Ignore variables that don't exist in work item |
Examples
*** Tasks ***
Delete work item variables username email
Save work item
Get Work Item File
Get attached file from work item to disk. Returns the absolute path to the created file.
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
name | null | ||
path | None |
Get attached file from work item to disk. Returns the absolute path to the created file.
param name: | Name of attached file |
---|---|
param path: | Destination path of file. If not given, current working directory is used. |
Examples
*** Tasks ***
${path}= Get work item file input.xls
Open workbook ${path}
Get Work Item Files
Get files attached to work item that match given pattern. Returns a list of absolute paths to the downloaded files.
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
pattern | null | ||
dirname | None |
Get files attached to work item that match given pattern. Returns a list of absolute paths to the downloaded files.
param pattern: | Filename wildcard pattern |
---|---|
param dirname: | Destination directory, if not given robot root is used |
Examples
*** Tasks ***
${paths}= Get work item files customer_*.xlsx
FOR ${path} IN @{paths}
Handle customer file ${path}
END
Get Work Item Payload
Get the full JSON payload for a work item.
NOTE: Most use cases should prefer higher-level keywords.
Examples
*** Tasks ***
${payload}= Get work item payload
Log Entire payload as dictionary: ${payload}
Get Work Item Variable
Return a single variable value from the work item, or default value if defined and key does not exist. If key does not exist and default is not defined, raises `KeyError`.
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
name | null | ||
default |
Return a single variable value from the work item, or default value if defined and key does not exist. If key does not exist and default is not defined, raises KeyError.
param key: | Name of variable |
---|---|
param default: | Default value if key does not exist |
Examples
*** Tasks ***
${username}= Get work item variable username default=guest
Get Work Item Variables
Read all variables from the current work item and return their names and values as a dictionary.
Read all variables from the current work item and return their names and values as a dictionary.
Examples
*** Tasks ***
${variables}= Get work item variables
Log Username: ${variables}[username], Email: ${variables}[email]
List Work Item Files
List the names of files attached to the current work item.
Examples
*** Tasks ***
${names}= List work item files
Log Work item has files with names: ${names}
List Work Item Variables
List the variable names for the current work item.
Examples
*** Tasks ***
${variables}= List work item variables
Log Available variables in work item: ${variables}
Load Work Item
Load work item for reading/writing.
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
workspace_id | null | ||
item_id | null |
param workspace_id: | |
---|---|
Workspace ID which contains item | |
param item_id: | Workitem ID to load |
- NOTE: Currently only one work item per execution is supported
- by Robocorp Cloud, which should be loaded automatically.
Load Work Item From Environment
Load current work item defined by the runtime environment.
The corresponding environment variables are:
- RC_WORKSPACE_ID
- RC_WORKITEM_ID
Remove Work Item File
Remove attached file from work item.
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
name | null | ||
missing_ok | True |
param name: | Name of attached file |
---|---|
param missing_ok: | |
Do not raise exception if file doesn't exist |
NOTE: Files are not deleted before work item is saved
Examples
*** Tasks ***
Remove work item file input.xls
Save work item
Remove Work Item Files
Removes files attached to work item that match given pattern.
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
pattern | null | ||
missing_ok | True |
param pattern: | Filename wildcard pattern |
---|---|
param missing_ok: | |
Do not raise exception if file doesn't exist |
Examples
*** Tasks ***
Remove work item files *.xlsx
Save work item
Save Work Item
Save the current data in the work item. If not saved, all changes are discarded when the library goes out of scope.
Save the current data in the work item. If not saved, all changes are discarded when the library goes out of scope.
Set Task Variables From Work Item
Convert all variables in the current work item to Robot Framework task variables.
Convert all variables in the current work item to Robot Framework task variables.
Examples
*** Tasks ***
# Work item has variable INPUT_URL
Set task variables from work item
Log The variable is now available: ${INPUT_URL}
Set Work Item Payload
Set the full JSON payload for a work item.
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
payload | null |
param payload: | Content of payload, must be JSON-serializable |
---|
NOTE: Most use cases should prefer higher-level keywords.
Examples
*** Tasks ***
${output}= Create dictionary url=example.com username=Mark
Set work item payload ${output}
Set Work Item Variable
Set a single variable value in the current work item.
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
name | null | ||
value | null |
param key: | Name of variable |
---|---|
param value: | Value of variable |
Examples
*** Tasks ***
Set work item variable username MarkyMark
Save work item
Set Work Item Variables
Set multiple variables in the current work item.
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
kwargs | null |
param kwargs: | Pairs of variable names and values |
---|
Examples
*** Tasks ***
Set work item variables username=MarkyMark email=mark@example.com
Save work item