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

I have the code below:


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:

randomEngagementNameGenerator: your function is also generated a random string already