# Accesing the elements of a task from outside the task

**URL:** <https://verificationacademy.com/forums/t/accesing-the-elements-of-a-task-from-outside-the-task/42666>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, task\
**Created:** [November 8, 2023, 10:10am UTC](https://verificationacademy.com/forums/t/accesing-the-elements-of-a-task-from-outside-the-task/42666 "2023-11-08T10:10:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Goutham\_K](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/g/77aa72/32.png) [@Goutham\_K](https://verificationacademy.com/forums/u/Goutham_K)\
**Post date:** [November 8, 2023, 10:10am UTC](https://verificationacademy.com/forums/t/accesing-the-elements-of-a-task-from-outside-the-task/42666/1 "2023-11-08T10:10:59Z")

</div>

Hi,

I am trying to access the elements of a task from outside of the task?  
How to achieve this?

Thanks and Regards  
Goutham K

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [November 8, 2023, 6:38pm UTC](https://verificationacademy.com/forums/t/accesing-the-elements-of-a-task-from-outside-the-task/42666/2 "2023-11-08T18:38:39Z")

</div>

_In reply to [Goutham K](https://verificationacademy.com/forums/t/accesing-the-elements-of-a-task-from-outside-the-task/42666):_

Not recommended, but you can declare your elements as static variables inside the task and reference them hierarchically from outside. A better option is moving the element outside the task.
