[FREE / Open Source] Dynamic Variables - Create Dynamic Variables


Simple extension for adding dynamic variables! You can rename, get values, delete and more!

P.S. I am just having fun making this extension. You can totally achieve these by dictionary lol


Blocks Description Method Code
Raises when any error occured. All errors explained in Errors.

Params Type
error String
errorCode int
methodCode int

Initialize/Change a variable. "name" and "value" can be anything but not nothing.

Params Type
name Any
value Any

Initialize/Change list of variables. Both list mustn't be empty. "names" and "values" must a list, and their length must be the same. Variable(s) is/are initialize/change in assending way.

Params Type
names List
values List
Returns: Any
Get value of a variable. If the variable isn't exist, return "not found".

Params Type
name Any

Returns: List
Get list of values. Input should be a list of variable's name. Output will a list of values in the order of input list. If any of the names isn't exist, that item will be "not found". If the input list is empty, or any error occurred, return an empty list.

Params Type
names List

Returns: List
Get all variable's names. Return an empty list if there's no variable, or when error occured.
Returns: List
Get all values. Return an empty list if there's no variable, or when error occurred.
Rename a variable. If the old variable doesn't exist, error will occur.

Params Type
oldName Any
newName Any

Rename a list of varibles. All list must not be empty. Length of both list must be the same. This method will rename variable(s) in assending order. If any one of the oldName doesn't exist, error will occur, but the oldNames before the error occurred will be renamed.

Params Type
oldNames List
newNames List

Returns: Any
Remove a variable. Return removed value. If variable's name doesn't exist, error will occur and return an empty string.

Params Type
name Any

Returns: List
Remove list of variables. Return a list of removed values. If any of variable's name doesn't exist, error will occur and return list of values that removed before the error occurred.

Params Type
names List

Remove all variables. If there's no variable exist, nothing will happen. 10
Returns: Boolean
Check if specific variable name exist. Return true of variable exists, otherwise false. Return false if error occurred.

Params Type
name Any

Returns: Number (int)
Return the number of variables. Return -1 if error occurred.
Returns: Boolean
Check if any variables exist. Return true if no variable exists, otherwise false. If error occurred, return false.


Error Code Error
0 Exception error
1 List cannot be empty
2 Length of both list must be same
3 Old variable doesn't exist

Change Log

No change log yet :wink:


Version 1 com.watermelonice.DynamicVariables.aix (15.1 KB)

Or download from :github: Github

Build Extensions

Go to this directory on github for the code. Check out the wiki page if you don’t know how to compile.


Great extension @WatermelonIce :partying_face: keep it up :+1:

it looks like you love YusufCihan dynamic components topic interface :crazy_face:

1 Like

Because it is neat and tidy :smiley:

Btw thanks for appreciation :laughing:


Yes it is :wink:

You’re welcome :grin:

1 Like

Nice Extension :100:

Yep, I also like it :grin:


Great extension @WatermelonIce :+1:t2:

nyc extension

1 Like

Can you please share a demo block?

For example, you can make a variable in this way:

Note this is not to save the value, only works when the app is still opened, like a normal variable.


Very very useful extension. :face_with_monocle: Thank you.

Getting error



This error isn’t related to dynamic variables(this topic) I think.

The error is because the add items to list block is expecting a list as parameter to list socket instead of a single item that you are currently passing

1 Like

Nice Extension!

I have one request, that is, get name and value from a file. Is this possible from with this extension?

Most possibly this reason.

@CJcorp If you can share the block image instead of using a phone to take pictures of the pc screen?


My extension has nothing to deal with files :sweat_smile:

But it has to deal with lists

It means we can’t use it in a loop where we add items to a list

You can, but you have to get it first.

like this:

ofc there is a more simple way to do it, this is for demonstration only.

1 Like

Ok will try it and will inform if it works or not for me

Edit :- working for me

1 Like