How do I access a variable?

This seems to be very basic, but I’m having a difficult time figuring this out. I basically want to access a variable that i defined in another part of my scenario to the final DigitalOcean module at the end. However, I can’t connect the value with that specific module, and the variable that i declared there doesn’t seem accessible.

Before your DigitalOcean module, can you get your variable with the Get Variable tools module?

4 Likes

Thanks @Donald_Mitchell, nope, I can’t access it through Get Variable either. For now I figured out an easy fix though, by just putting the regex parsing in front of the DigitalOcean module — which avoids using variables all together.

Make sure to check the router order by clicking on auto-align icon. Then if you made sure the create variable route is before the Digital Ocean module, you can simply add “get variable” module with the same name to get the variable again in another route.

3 Likes

I know you have a workaround… but if you set a variable, to access it from a different branch, you need to add a GetVariable item and insert the name of the variable. You then refer to this item for the variable value.
In your diagram… insert a GetVariable (or GetMultipleVariables) befor eyou DigitalOcean item, and add the variable you want to get. You can then refer to this in the DigitalOcean item.

2 Likes