# Re-use variable which is randomly generate

**URL:** <https://forum.robotframework.org/t/re-use-variable-which-is-randomly-generate/975>\
**Category:** Robot Framework\
**Created:** [19 November 2020 08:53 UTC](https://forum.robotframework.org/t/re-use-variable-which-is-randomly-generate/975 "2020-11-19T08:53:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Centaure13](https://avatars.discourse-cdn.com/v4/letter/c/58956e/32.png) [@Centaure13](https://forum.robotframework.org/u/Centaure13)\
**Post date:** [19 November 2020 08:53 UTC](https://forum.robotframework.org/t/re-use-variable-which-is-randomly-generate/975/1 "2020-11-19T08:53:55Z")

</div>

Hello,

Here is my first part of code :

_Keyword1_  
_{CREA\_AUTO}= Lexify CREA\_AUTO\_???\* \*Length Should Be {CREA\_AUTO} 13_

In this code, I generate randomly a string with the “Lexify” library.

On the second part of the code :  
_Keyword2_  
_Input text locator ${CREA\_AUTO}_

In this code, I would input the ${CREA\_AUTO} value on a field.

My issue is as the random string is not on the same keyword, I can’t collect the value.  
And i can’t group the 2 keywords (2 different use).

How can I declare as global variable the random string? I try Set global variable keyword but it doesn’t work (or I don’t know how to use it)

Thanks !
