Run macros in parallel and share their GLOBAL values among them

Hello,
is it possible to run macros in parallel but so that they share global values?

So far I have tried:
play all macros in the folder:
-plays only one after the other.
–If i create new browser profiles I can play macros in parallel but they don’t share global values anymore.

via autostart html:
-stops the first macro.
–create new browser profiles: open several in parallel but no longer share global values.

I would be very happy about any help.
thank you

As you mentioned, global variables are shared between all macros, but only in the same RPA instance.

How many values do you need to share between the running instances?

Suggestion 1 is to use the clipboard:

  • store | value | !clipboard to send value
  • store | ${!clipboard} | newvar to get value

If you need more than one value to you can still put it on the clipboard and then split the received string.

Suggestion 2 is to use a CSV file. In hard-drive mode the CSV file can be shared between all profiles running. Just use the same text file.

thank you for your quick reply!

i have about 16 variables that change several times during the run and the macro running in parallel should be aware of this.

so how can i change a value in the table without writing a new line when i save the csv file?

Example:
myVariables.csv
1.macro 1 ON
2.macro 2 ON

with csvreadarray i can read everything even if new things are added, thanks, that brings me further :slight_smile: but how can i change a value in a row without it being automatically written to the end. like it happens in !csvsave

example i want to change in the just saved file now line 1 to this:
myVariables.csv
1.macro 1 OFF
2.macro 2 ON

greetings :slight_smile:

Good question, and you were very close to the solution :wink:

The solution is indeed to use csvreadARRAY and csvsaveARRAY. These two commands have the full CSV in memory as array, so you can change any line. After changing the array cells as needed, just do a csvsavearray and keep the same CSV file name. This updates the file on the disk.

=> See this post: How to mark a row in a CSV line as processed?

Your task is the same :slight_smile: Except that instead of adding “Done” to a line, you would store the updated values e. g. “ON” or “OFF”.

I suggest you alternative fast and easy solution

  1. switch to hard drive mode (save macro in hard disk)
  2. create 1 macro with all global variable inside

store 1 global_var1
store 2 global_var2
store 10 global_var10

Copy this macro in every testsuite and rename in 1,json in this mode this macro will be always first macro executed.

Run unlimited test suite and every test suite load the global variables before.

Other solutions seems more complex and slow to use.

thank you for your help!

i would like to have a shorter and simpler solution.(this looks very complex to me :zipper_mouth_face:).

i thought of creating a .csv file for each variable.

so: macro1 on = macro1.csv ->(content only) on

then i can check it in other macros and if i want to change it hopefully it is not so complex.

what would the commands for this look like?

furthermore: the problem with the cache overflow/memoryleak of me was solved by switching from windows 7 to windows 10 and disabling all options(eg. under variable: show most common/ show advanced etc). now the cache doesn’t increase at all and i could run ui.vision 24/7!

i am still very convinced of your software and i am interested in your work and would like to have more infos on what improvements you are working on :slight_smile:
is there an info page?
and how much do people donate or how do you fund yourselves?
are you by any chance also working on the topics i mentioned here?(running parallel macros)

many greetings

this is a very good solution newkantuuser, but changing the values during the run would still be very complex. can you think of a solution?

i thought about writing a separate csv file with only one line for each variable and replace it to avoid the “times” and “columnrows” commands.

but i haven’t figured out yet how to replace the csv file with a new value.

1 Like

The easiest solution is to use a csv with the data to use but I suggest you think all the work to do, wait 3-5 days think if there is a better solution and realize the best solution.

Remember the more complex macros are and the easier they can give problems, the real ptofessionist works with short but efficient macro code to avoid useless commands that take up memory, slow down and can show bugs

1 Like

you are right.

when i wrote the code i thought that i can run macros in parallel in one environment, so i built the code accordingly. changing that now with the csv file is not optimal.

i’ll write it again from scratch with the new realizations of what is possible and then it will of course look completely different.

thanks for your help again :slight_smile:

1 Like