How to auto-generate random string at run time and populate a text field

I have the code below:

@Keyword

def randomEngagementNameGenerator() {

Date today = new Date()

String todaysDate = today.format('MMddyy')

String hr\_ident = 'Auto\_' + todaysDate

}

However, i would like to autogenerate a text field at run time, can someone explain how can i configure this?

is this what you are looking for: https://stackoverflow.com/questions/8138164/groovy-generate-random-string-from-given-character-set?

randomEngagementNameGenerator: your function is also generated a random string already