# Using Variable In another sequence

**URL:** <https://forum.uipath.com/t/using-variable-in-another-sequence/702845>\
**Category:** Activities\
**Tags:** question, studio, activities\
**Created:** [November 28, 2023, 5:53pm UTC](https://forum.uipath.com/t/using-variable-in-another-sequence/702845 "2023-11-28T17:53:20Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anelisa\_Bolosha1](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anelisa_bolosha1/32/496797_2.png) [@Anelisa\_Bolosha1](https://forum.uipath.com/u/Anelisa_Bolosha1)\
**Post date:** [November 28, 2023, 5:53pm UTC](https://forum.uipath.com/t/using-variable-in-another-sequence/702845/1 "2023-11-28T17:53:20Z")

</div>

Hi everyone please help, so I have a variable I created in SEQ1

 ![image](https://global.discourse-cdn.com/uipath/original/4X/c/8/7/c8771546be5ee4e276c4bf12e61ea34cc123607d.png)

And I want to use it in SEQ2

---

<div class="post-metadata">

**Author:** ![Shiva\_Nikhil](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/shiva_nikhil/32/267408_2.png) [@Shiva\_Nikhil](https://forum.uipath.com/u/Shiva_Nikhil)\
**Post date:** [November 28, 2023, 5:58pm UTC](https://forum.uipath.com/t/using-variable-in-another-sequence/702845/2 "2023-11-28T17:58:41Z")

</div>

@Anelisa_Bolosha1

Its better to convert it to argument and make the direction as out

If you want to use in another workflow?

Is this your requirement?

---

<div class="post-metadata">

**Author:** ![Parvathy](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/parvathy/32/484539_2.png) [@Parvathy](https://forum.uipath.com/u/Parvathy)\
**Post date:** [November 28, 2023, 5:58pm UTC](https://forum.uipath.com/t/using-variable-in-another-sequence/702845/3 "2023-11-28T17:58:42Z")

</div>

Hi @Anelisa_Bolosha1

Create an In Argument in Sequence 2 and when you invoke the Sequence 2 file map the argument you created with the variable in sequence 1. Will help if further assistance needed.

Regards,

---

<div class="post-metadata">

**Author:** ![Anelisa\_Bolosha1](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anelisa_bolosha1/32/496797_2.png) [@Anelisa\_Bolosha1](https://forum.uipath.com/u/Anelisa_Bolosha1)\
**Post date:** [November 28, 2023, 6:02pm UTC](https://forum.uipath.com/t/using-variable-in-another-sequence/702845/4 "2023-11-28T18:02:36Z")

</div>

Could you please send a xaml file as an example

---

<div class="post-metadata">

**Author:** ![Parvathy](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/parvathy/32/484539_2.png) [@Parvathy](https://forum.uipath.com/u/Parvathy)\
**Post date:** [November 28, 2023, 6:08pm UTC](https://forum.uipath.com/t/using-variable-in-another-sequence/702845/5 "2023-11-28T18:08:54Z")

</div>

@Anelisa_Bolosha1

Sequence 2 has variable created

 ![image](https://global.discourse-cdn.com/uipath/original/4X/0/0/5/005af9a18fdbf46ca1538f0bd314355e121b3484.png)  
Sequence 3 has argument created  
 ![image](https://global.discourse-cdn.com/uipath/original/4X/1/5/d/15d545a1ff3f04e94a19703cbe74d796959f75a8.png)  
when you call the workflow you can map the variables and arguments.  
 ![image](https://global.discourse-cdn.com/uipath/original/4X/f/0/e/f0e7740c5854956c760182f9f578acc13508e98e.png)

Hope it helps!!

---

<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:** [November 28, 2023, 6:20pm UTC](https://forum.uipath.com/t/using-variable-in-another-sequence/702845/6 "2023-11-28T18:20:15Z")

</div>

That is absolutely not how you do it.

@Anelisa_Bolosha1 you need to change the scope of the variable in the variables pane so that it’s at a higher scope and therefore available to both sequences.

---

<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:** [November 28, 2023, 6:21pm UTC](https://forum.uipath.com/t/using-variable-in-another-sequence/702845/7 "2023-11-28T18:21:19Z")

</div>

Why are you assuming Invoke Workflow? You can have multiple Sequences without using Invoke Workflow.

@Anelisa_Bolosha1 please show us your code so we can understand what you’re doing.

---

<div class="post-metadata">

**Author:** ![Anelisa\_Bolosha1](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anelisa_bolosha1/32/496797_2.png) [@Anelisa\_Bolosha1](https://forum.uipath.com/u/Anelisa_Bolosha1)\
**Post date:** [November 28, 2023, 6:44pm UTC](https://forum.uipath.com/t/using-variable-in-another-sequence/702845/8 "2023-11-28T18:44:07Z")

</div>

This is my seq1:

 ![image](https://global.discourse-cdn.com/uipath/original/4X/6/3/3/63357bf8f0e7956be9a10c159099ed74a49d6e52.png)

This is my seq2:

 ![image](https://global.discourse-cdn.com/uipath/original/4X/7/a/d/7ad8ab52230594c73827175ca069627454bd430b.png)  
There is some wrong in the invoke

This ‘main’ is my seq1 then ‘API\_Autocase\_Create’ is my seq2  
 ![image](https://global.discourse-cdn.com/uipath/original/4X/6/8/4/684e599567be8f8cffef35b066fb19acedf9d7d8.png)

---

<div class="post-metadata">

**Author:** ![Shiva\_Nikhil](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/shiva_nikhil/32/267408_2.png) [@Shiva\_Nikhil](https://forum.uipath.com/u/Shiva_Nikhil)\
**Post date:** [November 28, 2023, 6:55pm UTC](https://forum.uipath.com/t/using-variable-in-another-sequence/702845/9 "2023-11-28T18:55:25Z")

</div>

@Anelisa_Bolosha1

Change the scope of emailbody to main

Can you explain where you are facing issue

In the image ever thing is fine i think?

---

<div class="post-metadata">

**Author:** ![Anelisa\_Bolosha1](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anelisa_bolosha1/32/496797_2.png) [@Anelisa\_Bolosha1](https://forum.uipath.com/u/Anelisa_Bolosha1)\
**Post date:** [November 28, 2023, 7:03pm UTC](https://forum.uipath.com/t/using-variable-in-another-sequence/702845/10 "2023-11-28T19:03:08Z")

</div>

I want to print out email body in seq2

---

<div class="post-metadata">

**Author:** ![Anelisa\_Bolosha1](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anelisa_bolosha1/32/496797_2.png) [@Anelisa\_Bolosha1](https://forum.uipath.com/u/Anelisa_Bolosha1)\
**Post date:** [November 28, 2023, 7:05pm UTC](https://forum.uipath.com/t/using-variable-in-another-sequence/702845/11 "2023-11-28T19:05:54Z")

</div>

The scope of emailbody is the ‘sequence’

 ![image](https://global.discourse-cdn.com/uipath/original/4X/8/f/f/8ff806dac8cef3e123fece2dbde88ed325ff0799.png)

---

<div class="post-metadata">

**Author:** ![Gayathri\_Ramanathan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gayathri_ramanathan/32/447592_2.png) [@Gayathri\_Ramanathan](https://forum.uipath.com/u/Gayathri_Ramanathan)\
**Post date:** [November 29, 2023, 3:00am UTC](https://forum.uipath.com/t/using-variable-in-another-sequence/702845/12 "2023-11-29T03:00:40Z")

</div>

From Seq1 you are passing emailbody to emailAPI\_Body as an argument.

So ideally, in seq2 you should use emailAPI\_Body variable and not emailbody variable

Hope this helps @Anelisa_Bolosha1

---

<div class="post-metadata">

**Author:** ![akshay616](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/akshay616/32/62735_2.png) [@akshay616](https://forum.uipath.com/u/akshay616)\
**Post date:** [November 29, 2023, 8:24am UTC](https://forum.uipath.com/t/using-variable-in-another-sequence/702845/13 "2023-11-29T08:24:09Z")

</div>

Variables are intended to use inside the workflow only. If you want to pass value to another workflow you need to create it as an argument.

---

<div class="post-metadata">

**Author:** ![Anelisa\_Bolosha1](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anelisa_bolosha1/32/496797_2.png) [@Anelisa\_Bolosha1](https://forum.uipath.com/u/Anelisa_Bolosha1)\
**Post date:** [November 29, 2023, 8:25am UTC](https://forum.uipath.com/t/using-variable-in-another-sequence/702845/14 "2023-11-29T08:25:31Z")

</div>

Solved thank you so much

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [December 2, 2023, 8:26am UTC](https://forum.uipath.com/t/using-variable-in-another-sequence/702845/15 "2023-12-02T08:26:13Z")

</div>

Closed on December 2, 2023, 8:26am UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
