Increase value +1 per loop

Hello, I want to increase the value of the type command by +1 every loop. How can I do that?


(For example, it starts from the first 1 and will increase +1 every loop.)

To increase loop or others variable you can use this command

{
  "Command": "executeScript_Sandbox",
  "Target": "return Number (${Loop_Counter}) + 1",
  "Value": "Loop_Counter"
},

Thanks for your answer. I did what you said but I get this error. I’m a newbie, sorry. :slight_smile:
[error] variable “LOOP_COUNTER” is not defined

Your code macro is wrong you must study ui vision docs

https://ui.vision/rpa/docs

Here a code to do a loop, your macro code is wrong.

Macro Code:

{
  "Name": "Loop_Some_Times",
  "CreationDate": "2020-6-12",
  "Commands": [
    {
      "Command": "store",
      "Target": "true",
      "Value": "!errorignore"
    },
    {
      "Command": "bringBrowserToForeground",
      "Target": "",
      "Value": ""
    },
    {
      "Command": "store",
      "Target": "0",
      "Value": "Loop_Counter"
    },
    {
      "Command": "label",
      "Target": "Engine_Code",
      "Value": ""
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "return Number (${Loop_Counter}) + 1",
      "Value": "Loop_Counter"
    },
    {
      "Command": "echo",
      "Target": "Loop Counter Is ${Loop_Counter}",
      "Value": "#shownotification"
    },
    {
      "Command": "gotoIf_v2",
      "Target": "${Loop_Counter} < 5",
      "Value": "Engine_Code"
    }
  ]
}

If you want to type 1, on clicking name sayfa, then 2,3… on consecutive loops.

After command :open, site.com add following:

{
“Command”: “executeScript_Sandbox”,
“Target”: “return Number (${!loop})+1”,
“Value”: “AAA”
},

{
  "Command": "click",
  "Target": "name=sayfa",
  "Value": ""
},

{
  "Command": "type",
  "Target": "name=sayfa",
  "Value": "${AAA}"
},