Skip to main content
Solved

Create a UUID as a parameter that persists through the whole workbench


oliver.morris
Contributor
Forum|alt.badge.img+12

Morning,

I would like to create a UUID in my workbench as a parameter and call it at various points through my workbench. The issue I have is that currently it keeps generating me a new UUID every time I call it. I am using the @UUID() function.

Is there a way to populate the parameter once and persist it thoughout the workbench so I can use it in filenames, database table names etc.

Many Thanks,

Oliver

Best answer by david_r

I use this pattern with a private scripted parameter quite a lot:

0684Q00000ArLfsQAF.png

Code:

import uuid
return str(uuid.uuid4())

It's then easy to reference this parameter value wherever you need it in the workspace.

View original
Did this help you find an answer to your question?

2 replies

david_r
Evangelist
  • Best Answer
  • July 10, 2018

I use this pattern with a private scripted parameter quite a lot:

0684Q00000ArLfsQAF.png

Code:

import uuid
return str(uuid.uuid4())

It's then easy to reference this parameter value wherever you need it in the workspace.


oliver.morris
Contributor
Forum|alt.badge.img+12
  • Author
  • Contributor
  • July 10, 2018
@david_r

Thank you this works perfectly for my needs.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings