make a new action: delete a variable

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

Locked
houdinix64
Posts: 33
Joined: 08 Mar 2013 12:45

make a new action: delete a variable

Post by houdinix64 » 28 Dec 2015 02:46

im newbie in programming. Instead of using removemapentry function, i think its easy if theres an action "remove variable".. I want to remove all contents in variable map with no user interaction.. im sorry i cannot explain it well and for my bad english

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: make a new action: delete a variable

Post by MURTUMA » 28 Dec 2015 07:11

Do you mean local or global variable?

Local variables are not stored permanently. They are lost when flows using them stops executing.

For global vars, there are a script function for deleting them: removeVariable(name). Other way is deleting variables.bin file from automagic folder, if you want to delete them altogerther without precise control.

houdinix64
Posts: 33
Joined: 08 Mar 2013 12:45

Re: make a new action: delete a variable

Post by houdinix64 » 15 Jul 2016 08:16

using action script "removeVariable(name)" doesnt work for me..I been executed the action with no errors but still the global variable exist in "global variable list"..I dont want to delete the variable.bin inside automagic folder.

example I created a action script:
removeVariable(global_dateA);
removeVariable(global_dateB);
removeVariable(global_dateC)

is there anything that i missed?

User avatar
Bushmills
Posts: 286
Joined: 23 Sep 2014 21:56

Re: make a new action: delete a variable

Post by Bushmills » 15 Jul 2016 08:35

Yes, you forgot to quote the name, as in
removeVariable("global_dateA");
otherwise you'll (try to) remove a variable with the name expressed by the value of global_dateA.
I dont want to delete the variable.bin
no need to, simply use removeVar() correctly.

Locked