Action Block variable handling needs improvements

FrameXX

Well-known member
Ok.

So I am building an action block and I want to work with some variables only inside that action block, before giving some clear output. So what are my options? None? Well, It seems I am going to settle for messing with my variables inside output parameters/variables area.

Now I want to configure a 'Wait Before Next Action' and use one of these output variables that I need to work with (because only they are editable) as a time value but... OUCH! The spinner chooser thingy doesn't let me choose from output variables, but only from input and global variables. Why?!?



Sorry for this start, but I had a need to describe how uncomfortable/impossible it currently is to work with variables in an action block. So what I wanted to point out:

  • Local scope variables are missing
If I understand it right, action blocks are based on a basic idea of functions in programming. But in most programming languages I can declare a local scope variables and work with them only in that function if I want. This is missing from MacroDroid action blocks and it seems to me that my only option is to use output parameters which is ok to use, but of course all of these variables, will then show up as output options and render the overall output of action block to be little messy. However I think anyone can overcome this, but what I can't overcome is that:
  • Variable spinner doesn't show output variables as an option
I think in this case it's seemingly visible where I have the probelm. I would like to make some changes to an input variables (that would mean save it to some output variable) and after that use it in wait action, however I can't. In my opinion the best solution here would be replacing the spinner with input field that has a magic text support and do this in all other actions that still use spinner for choosing variable.



I know there may be some workarounds for what I am complaining about like using shell to save variables and maybe more..., but I still thing that MacroDroid action block should still be comfortably usable without these workarounds. What about you?

So Jamie please don't leave Action Blocks as a temporary done functionality, because I thing it's still not 100% functionable as it should in it's current state.



EDIT

I also found out that output variables seem to be kind of broken. This action block would always show the right output in toast message, but wouldn't ever give me that output. It just outputs nothing.


Screenshot_20220307-143943.png
 
Last edited:

FrameXX

Well-known member
I haven't used action blocks yet and I'm not going to use because of lack of local variables

You technically can use output variables as local variables it's just not most comfortable.

Overally I think action blocks are a very good idea. I was on to make an action block that would allow for a custom vibration pattern with only one limitation being that a single vibration can't be longer than 1000ms, but problems described here disallowed me to do so.
 
Last edited:

dsnz

Well-known member
yes it's not comfortable, it's messy also if you need many local variables
for example I want to make a http request with retries (in case of temporary failure; and there are more examples of actions that can fail temporarily)
I need at least 4 local variables for this
and for some advanced text manipulation action blocks , many more may be needed

it's not a solution to use output variables (they are visible and they should not be)
 
Top