Skip to main content
Solved

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

  • July 10, 2018
  • 2 replies
  • 72 views

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

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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

david_r
Celebrity
  • 8394 replies
  • 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+14
  • Author
  • Contributor
  • 176 replies
  • July 10, 2018
@david_r

Thank you this works perfectly for my needs.