Array of Variables

I know, RM5 does not directly support Array of Variables.
In a short, I am looking for the way how to create an array of variables indirectly.

So, I am trying to create some sort of Virtual Variable Array.
For the test I created next set of Hub Variables:


The idea is to create a Variable which will be Value of "PlayMessage_X" variable
based on variable "PlayMessage_Idx".
Here is a test set of actions:

First line successfully created a variable "MessageToPlay" based on index
(index is a variable "PlayMessage_Idx")
Now I need to populate value for the variable "MP3_File" with actual file name
defined by variable "PlayMessage_1" (it should look like line-3) but based on
value of variable "MessageToPlay". The attempt to do this is on line-2 but the
result is : variable "MP3_File" is populated with value of "MessageToPlay" variable.
This actually the correct behavior.
But I am looking for the way for how to cascade variable population.
I understand, my description of what I am trying to do is not very clear but
I am not sure how to better describe this.

instead of that (as Im not tracking this very well), can you not identify which file to play based on some condition? Something has to dictate your desire and therefore your file?

If you describe what you are trying to do, it might be easier to follow as well

1 Like

In legacy RM4 I have many rules with announcements. All they are working
perfectly fine. Gradually I am moving all my rules to RM5. All announcements
are stored in local MP3 files. When whatever rule needs to play an announcements
first it populates a variable and then this variable sends to speech device(s).
Depend on conditions some rules may need to play more than one announcement.
In my new approach I am planning to create triggerless "Play Announcement"
rule which will play number of announcements basedg on index.
That is why I am trying to create an array of variables.
In case of success the rule will have a loop instead of chained if-then-else
staments.