BotreamDocs Website Türkçe v0.1.1

Loop commands

loop · break · continue

loop Loop

Repeats the enclosed commands.

Block command: loop … endloop.

Parameters of every variant

ParameterValueDefaultDescription
--measuretrue / falsefalseRecord every round for the performance report: start, end, robot, units, human time against robot time (Administration → Performance)
--unitcountnumber1Measured rounds: business transactions one round handles (e.g. invoices in the batch)
--humansecondsnumberMeasured rounds: seconds a person needs for one unit of this work
--businessunittextMeasured rounds: business unit to report under (the task's unit when empty)

Types (--type)

--type:range
ParameterValueDefaultDescription
--from requirednumber
--to requirednumber
--stepnumber1
--variable requiredvariable nameThe current number: --from, then --from + --step… up to --to
--type:times

Runs the enclosed commands a fixed number of times (0 or less: not at all).

ParameterValueDefaultDescription
--times requirednumberHow many times, e.g. 5 or $count$
--indexvariable nameVariable that receives the round's position, starting at 0 (the first item is 0, as in $list[0]$)
--type:list
ParameterValueDefaultDescription
--list required$variable$
--variable requiredvariable name
--indexvariable nameVariable that receives the round's position, starting at 0 (the first item is 0, as in $list[0]$)
--type:datatable

Runs once per row of a datatable variable (e.g. from capture --action:gettable, database --action:query or csv --action:read).

ParameterValueDefaultDescription
--table required$variable$The datatable variable
--variable requiredvariable nameThe current row: $row.Column$
--indexvariable nameVariable that receives the round's position, starting at 0 (the first item is 0, as in $list[0]$)
--type:condition
ParameterValueDefaultDescription
--condition requiredcondition
--checkone of before, afterbeforebefore: the condition is tested before every round (the body may never run); after: the body runs once first and the condition is tested after every round (do-while)
--type:excelrows
ParameterValueDefaultDescription
--session requiredtextSession name given when the workbook was opened Names a excel session opened earlier.
--sheettextDefaults to the active sheet
--headertrue / falsetrueFirst row holds column names
--variable requiredvariable name
--indexvariable nameVariable that receives the round's position, starting at 0 (the first item is 0, as in $list[0]$)
--type:eachfile
ParameterValueDefaultDescription
--folder requiredtextA folder on the agent machine.
--filtertext*.*
--subfoldertrue / falsefalseInclude subfolders
--variable requiredvariable name
--indexvariable nameVariable that receives the round's position, starting at 0 (the first item is 0, as in $list[0]$)
--type:eachfolder
ParameterValueDefaultDescription
--folder requiredtextA folder on the agent machine.
--subfoldertrue / falsefalseInclude subfolders
--variable requiredvariable name
--indexvariable nameVariable that receives the round's position, starting at 0 (the first item is 0, as in $list[0]$)
--type:queue

Takes work items from a queue until it is empty, one per round: an item whose round ends normally is completed, one whose round fails is failed (and retried later while the queue allows) while the loop goes on with the next item.

ParameterValueDefaultDescription
--queue requiredtextName of the work queue (Queues page)
--variable requiredvariable nameThe work item: $item.Data.Field$, $item.Reference$, $item.Id$, $item.Attempt$
--indexvariable nameVariable that receives the round's position, starting at 0 (the first item is 0, as in $list[0]$)
--type:mail

Runs once per e-mail of a mailbox folder that matches the filters, newest first. The messages are read when the loop starts (as mail --action:read); inside, mail --action:saveattachments, move, markread or delete --id:$msg.Id$ work on the current one.

ParameterValueDefaultDescription
--server requiredtextIMAP server, e.g. imap.gmail.com or outlook.office365.com
--portnumber993993 for TLS (usual), 143 for STARTTLS or unencrypted
--vaulttextVault that holds the mail account (Vaults page); --credential is then the name of the credential in it
--credential requiredany valueThe mail account: the name of a credential in --vault (its user name and password, kept on the Vaults page), or a credential variable ($cred$). Gmail, Outlook.com and Yahoo need an app password; with --authtype:oauth2 the credential is the app registration (client id / client secret)
--securityone of auto, ssl, starttls, noneautoauto: TLS on ports 465/993, STARTTLS when the server offers it on other ports (a password is never sent unencrypted); ssl: TLS from the start; starttls: must switch to TLS; none: unencrypted (internal servers only)
--ssltrue / falseOlder form of --security: false = none, true = TLS or STARTTLS (--security wins when both are set)
--timeoutnumber60Seconds to wait for the mail server before giving up
--ignoresslerrorstrue / falsefalseAccept any server certificate (internal servers with a self-signed certificate); keep false for public servers
--authtypeone of password, oauth2passwordoauth2: Microsoft 365 sign-in with an app registration (IMAP.AccessAsApp / SMTP.SendAsApp), for mailboxes where password sign-in is switched off
--tenanttextoauth2: the Microsoft 365 directory, e.g. contoso.onmicrosoft.com or its id
--mailboxtextoauth2: the address whose mailbox is used (send: the --from address when empty)
--foldertextINBOXMail folder, e.g. INBOX or Processed (mail --action:folders lists them)
--unreadtrue / falsetrueOnly unread messages
--fromtextOnly messages whose sender contains this
--totextOnly messages whose recipients contain this
--subjecttextOnly messages whose subject contains this
--bodytextOnly messages whose text contains this
--sinceany valueOnly messages received on or after this date
--beforeany valueOnly messages received before this date
--hasattachmentstrue / falsetrue: only messages with attachments; false: only messages without
--maxnumber50At most this many messages
--markreadtrue / falsefalseMark all the messages read when the loop starts (before the rounds run)
--variable requiredvariable nameThe current message: $msg.Subject$, $msg.From$, $msg.FromName$, $msg.To$, $msg.Cc$, $msg.Date$, $msg.Body$, $msg.HtmlBody$, $msg.IsRead$, $msg.Attachments$, $msg.Id$
--indexvariable nameVariable that receives the round's position, starting at 0 (the first item is 0, as in $list[0]$)

Examples

loop --type:range --from:1 --to:10 --step:1 --variable:i
    log --message:"Index: $i$"
endloop
loop --type:list --list:$myList$ --variable:item
    log --message:"Item: $item$"
endloop
loop --type:condition --condition:$counter$<100
    number --action:increment --name:counter --by:1
endloop

break Break

Exits the current loop.

continue Continue

Skips to the next loop iteration.

Botream 0.1.1 · Generated 2026-10-14