# Global Variable

**URL:** <https://forum.uipath.com/t/global-variable/1735>\
**Category:** Studio\
**Tags:** completed, studio\
**Created:** [February 21, 2017, 6:51am UTC](https://forum.uipath.com/t/global-variable/1735 "2017-02-21T06:51:06Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![PrafullK](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/prafullk/32/176716_2.png) [@PrafullK](https://forum.uipath.com/u/PrafullK)\
**Post date:** [February 21, 2017, 6:51am UTC](https://forum.uipath.com/t/global-variable/1735/1 "2017-02-21T06:51:07Z")

</div>

How to create global variable and use through the multiple workflows?

---

<div class="post-metadata">

**Author:** ![akhi\_s27](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/akhi_s27/32/1687_2.png) [@akhi\_s27](https://forum.uipath.com/u/akhi_s27)\
**Post date:** [February 21, 2017, 6:56am UTC](https://forum.uipath.com/t/global-variable/1735/2 "2017-02-21T06:56:25Z")

</div>

I’ve created dictionary(Of String, Object) and pass it across my xaml’s as In/Out argument.  
This way I can access all dictionary entries across all my workflows and all edits to the values are also available.

---

<div class="post-metadata">

**Author:** ![Lucas.Pimenta](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/lucas.pimenta/32/170092_2.png) [@Lucas.Pimenta](https://forum.uipath.com/u/Lucas.Pimenta)\
**Post date:** [February 21, 2017, 1:31pm UTC](https://forum.uipath.com/t/global-variable/1735/3 "2017-02-21T13:31:50Z")

</div>

Hello!

To use variables through workflows, you just have to pass it as arguments in “Invoke workflow file” Activity (Arguments property).

Hope It Helps!

Regards,

---

<div class="post-metadata">

**Author:** ![richarddenton](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/richarddenton/32/11819_2.png) [@richarddenton](https://forum.uipath.com/u/richarddenton)\
**Post date:** [February 22, 2017, 11:28am UTC](https://forum.uipath.com/t/global-variable/1735/4 "2017-02-22T11:28:07Z")

</div>

Ultimately you should be using Orchestrator which allows you to create assets and credentials which can be used throughout multiple processes. Of course this comes with price 😃

---

<div class="post-metadata">

**Author:** ![bristighosal910](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@bristighosal910](https://forum.uipath.com/u/bristighosal910)\
**Post date:** [August 23, 2018, 1:42pm UTC](https://forum.uipath.com/t/global-variable/1735/5 "2018-08-23T13:42:20Z")

</div>

I have the same question.  
If I want to use a variable in 50 workflows, it is a very tedious job to pass it argument to the next 49 workflows. Is there any way that I can use the global variable in all my workflows without passing it as argument?

---

<div class="post-metadata">

**Author:** ![bristighosal910](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@bristighosal910](https://forum.uipath.com/u/bristighosal910)\
**Post date:** [August 23, 2018, 1:43pm UTC](https://forum.uipath.com/t/global-variable/1735/6 "2018-08-23T13:43:52Z")

</div>

Is there any other way? Like can this be done with flowcharts or state machines?

---

<div class="post-metadata">

**Author:** ![Ignacio\_Insua\_Feito](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ignacio_insua_feito/32/20273_2.png) [@Ignacio\_Insua\_Feito](https://forum.uipath.com/u/Ignacio_Insua_Feito)\
**Post date:** [August 23, 2018, 2:00pm UTC](https://forum.uipath.com/t/global-variable/1735/7 "2018-08-23T14:00:17Z")

</div>

@bristighosal910 a good idea as an improve to usability for workflows could be to automatically assign as input variables when you import if you have them in the context with exactly the same type and name.

Anyways workflows are similar to functions and probably don’t even have to be part of the process itself since you can use them through multiple processes so… using global variables… its an option but not a best practice

---

<div class="post-metadata">

**Author:** ![bristighosal910](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@bristighosal910](https://forum.uipath.com/u/bristighosal910)\
**Post date:** [October 25, 2018, 4:53am UTC](https://forum.uipath.com/t/global-variable/1735/8 "2018-10-25T04:53:23Z")

</div>

Okay, Thank you.

---

<div class="post-metadata">

**Author:** ![iRon](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/iron/32/56635_2.png) [@iRon](https://forum.uipath.com/u/iRon)\
**Post date:** [February 12, 2019, 9:21am UTC](https://forum.uipath.com/t/global-variable/1735/9 "2019-02-12T09:21:07Z")

</div>

You might consider to use **Environment** variables stored in the current process.  
The are accessible through the [`Get Environment Variable`](https://activities.uipath.com/docs/get-environment-variable) activity or inline, like: `Environment.GetEnvironmentVariable("Domain")`

You can set them with an InvokeMethode activity, e.g:  
 ![image](https://global.discourse-cdn.com/uipath/original/3X/e/e/ee407aa183f7f7cc7538576d3884c1474bbefa2b.png)  
[SetEnvironment.xaml](https://global.discourse-cdn.com/uipath/original/3X/9/b/9bf8191a52eddf6512f339c010e241047b2cf5f2.xaml) (7.1 KB)

_Note_: you can only globalize **String** type variables this way

---

<div class="post-metadata">

**Author:** ![KenBrady](https://avatars.discourse-cdn.com/v4/letter/k/a698b9/32.png) [@KenBrady](https://forum.uipath.com/u/KenBrady)\
**Post date:** [March 18, 2019, 4:16pm UTC](https://forum.uipath.com/t/global-variable/1735/11 "2019-03-18T16:16:35Z")

</div>

You could define a custom .NET type, maybe a static class with public (static) fields and properties. This class could be initialized when your workflow starts, and the values are then accessible throughout all workflows via the static interface. This class might even be smart enough to initialize itself from the config file. Like any custom type, you would need to bring it into UIPath via the package manager.

---

<div class="post-metadata">

**Author:** ![lawanyaram](https://avatars.discourse-cdn.com/v4/letter/l/9fc29f/32.png) [@lawanyaram](https://forum.uipath.com/u/lawanyaram)\
**Post date:** [December 19, 2017, 7:03am UTC](https://forum.uipath.com/t/global-variable/1735/12 "2017-12-19T07:03:46Z")

</div>

Can there be a global variable which can be accessed across workflows in a project without passing as argument in workflows

---

<div class="post-metadata">

**Author:** ![ddpadil](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ddpadil/32/49955_2.png) [@ddpadil](https://forum.uipath.com/u/ddpadil)\
**Post date:** [December 19, 2017, 9:28am UTC](https://forum.uipath.com/t/global-variable/1735/13 "2017-12-19T09:28:07Z")

</div>

Hello there,  
It’s been [proposed](https://forum.uipath.com/t/global-variables-global-assets/2157/2) already. 🙂  
However you could do via [dictionary or Orchestrator assets](https://forum.uipath.com/t/global-variable/1735/3) .

---

<div class="post-metadata">

**Author:** ![lawanyaram](https://avatars.discourse-cdn.com/v4/letter/l/9fc29f/32.png) [@lawanyaram](https://forum.uipath.com/u/lawanyaram)\
**Post date:** [December 19, 2017, 12:25pm UTC](https://forum.uipath.com/t/global-variable/1735/14 "2017-12-19T12:25:45Z")

</div>

i am currently using assets or dictionary. but as a framework when i try to fetch all values initially it requires passing them as arguments across workflows. else i need to access asset in each workflow

---

<div class="post-metadata">

**Author:** ![Manoj\_Batra](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/manoj_batra/32/524050_2.png) [@Manoj\_Batra](https://forum.uipath.com/u/Manoj_Batra)\
**Post date:** [October 23, 2019, 11:04am UTC](https://forum.uipath.com/t/global-variable/1735/15 "2019-10-23T11:04:16Z")

</div>

Hi,

you can use [this](https://go.uipath.com/component/getter-setter) component to set your variables globally. it follows the pattern declare once and use anywhere in the project. This component supports all data types supported by UIPath.

Thanks,  
Manoj Batra

---

<div class="post-metadata">

**Author:** ![mwerner](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/mwerner/32/198153_2.png) [@mwerner](https://forum.uipath.com/u/mwerner)\
**Post date:** [January 22, 2021, 2:55pm UTC](https://forum.uipath.com/t/global-variable/1735/16 "2021-01-22T14:55:24Z")

</div>

You can use the **Velocistar Global Variables Activities** now!

> **[Velocistar GlobalVariables Activites - RPA Component | UiPath Marketplace](https://marketplace.uipath.com/listings/velocistar-globalvariables-activites)**
>
> Share globally any type of variable through your Robot's workflows without passing it through arguments. Ideal to use for configuration like Orchestrator-asse...

---

<div class="post-metadata">

**Author:** ![huatrung102](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/huatrung102/32/181510_2.png) [@huatrung102](https://forum.uipath.com/u/huatrung102)\
**Post date:** [May 25, 2021, 3:27am UTC](https://forum.uipath.com/t/global-variable/1735/17 "2021-05-25T03:27:34Z")

</div>

hi @mwerner i got problem of your global variable activities. the output of GetAll global variable type of “String” i cant set it to Dictionary\<string, object\>, could you fix it or tell me what i missed something, thank you

---

<div class="post-metadata">

**Author:** ![alexandretperez](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/alexandretperez/32/122698_2.png) [@alexandretperez](https://forum.uipath.com/u/alexandretperez)\
**Post date:** [May 27, 2021, 8:25pm UTC](https://forum.uipath.com/t/global-variable/1735/18 "2021-05-27T20:25:24Z")

</div>

I don’t like the idea.

Global variables can be altered anywhere and makes difficult to tracking all the sequence of changes that you did in the variable. It can be anywhere in the code.

Another problem is that everyone will start to thinking: “If I can set a value here and get this value in anywhere why I should continue passing arguments to worfklow? I will just abandon that and use Global Variables for everything.”

Global variables brings more drawbacks than benefits.

---

<div class="post-metadata">

**Author:** ![postwick](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/postwick/32/227083_2.png) [@postwick](https://forum.uipath.com/u/postwick)\
**Post date:** [May 27, 2021, 8:32pm UTC](https://forum.uipath.com/t/global-variable/1735/19 "2021-05-27T20:32:10Z")

</div>

Orchestrator Asset

---

<div class="post-metadata">

**Author:** ![postwick](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/postwick/32/227083_2.png) [@postwick](https://forum.uipath.com/u/postwick)\
**Post date:** [May 27, 2021, 8:34pm UTC](https://forum.uipath.com/t/global-variable/1735/20 "2021-05-27T20:34:01Z")

</div>

Let’s ask the important question here. **Why** are you using multiple workflows? Is it really necessary? This seems to be very common with UiPath developers, but isn’t often necessary. UiPath likes to push their REFramework that does this, and it’s overkill and overcomplicated for most automations.

Why can’t your entire process just be built in one workflow?

---

<div class="post-metadata">

**Author:** ![scott.taylor](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/scott.taylor/32/178824_2.png) [@scott.taylor](https://forum.uipath.com/u/scott.taylor)\
**Post date:** [July 8, 2021, 1:02pm UTC](https://forum.uipath.com/t/global-variable/1735/21 "2021-07-08T13:02:01Z")

</div>

Well, seems to be slight issue with Orchestrator Assets or Orchestrator in general as we and others have encountered issues when using Orchestrator Activities. If you search through the Forum you will see various postings around this issue. The issue is that these Orch Activities are in essence timing out or not returning, therefore you have to wrap them within a RETRY and even then, it does not work 100% of the time.  
So far the only response from UiPath has been that it is a Data issue, too much Data in that Orchestrator cannot return the results fast enough.  
We have trimmed down the amount of Data in our SQL Tables, we have optimized Indexes (Fragmentation Routines), but it still continues.  
So, overall, would not recommend or rely on Orchestrator Assets for a solution.

[Next page](https://forum.uipath.com/t/global-variable/1735.md?page=2)
