Store a new string variable based on a generated stringbuilder

Hello,

I have an ID generator that generates a string of 5 numerical digits randomly. I want for instance when “54361” is generated in a message box, I store it in its own variable. I need this because currently, if I stop the script, that string number will be lost. And I want to use it again in my project.

Hi @private_matter ,

Could you elaborate on “It’s own variable” ?

If you want to dynamically generate variables with the value generated, I’m afraid it’s not possible.

But for such cases, we do use Dictionary data types, where we can map the Key as the Value name itself.

2022-06-29_141742

2022-06-29_141805

I want 47976 to be stored in a string variable.
Ex: “ID_Number” of variable type string has default VB expression set to “47976”.

@loginerror

any ideas how this can be done?

Hi @private_matter,

Create an asset for this and you can update or read it every time you work. Please try to test this and let us know if you have problems.

Regards,
MY

I appreciate your help but that is not what I was asking for. I know that I can create an asset with a fixed value, but the thing is that this value will be different every time the bot executes the process. I want when the bot generates an ID string from Studio, to store that string inside a variable that can later be used even if the execution has stopped.

So let’s say the bot generated “43521” and it’s set in a variable called ID_Number,

I can set in the clipboard to ID_Number and it’ll use the one contained in that variable. Hope you get what I mean.

If you want to dynamically generate variables with the value generated, I’m afraid it’s not possible.

Yes that’s what I want.

The robot ran, generated a value, and went and updated the entity. The next work has begun. You took the variable from the entity and created a new value and updated this entity again. isn’t it like that?

Don’t just think of the asset as static, you can also update this value in the process.

If after generated the ID number, it can store the value as an Asset text in Orchestrator, and then get the asset value from Orchestrator again, then yes, that would be good. I know how to get an asset such as text or credential from Orchestrator but I don’t know how to store one to it as the bot is running.

You can test it as in the pictures.

image
image

That might be the solution. Let me run a quick test and get back to you to see if it’s working as intended.

Yes it worked!!!

That was brilliant. I tested several times and it updated in orchestrator and now I can easily get that value whenever I want. I can finally continue my project. Cheers.

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.