Problem Setting a Particular Variable

I am an active user and I've created many macros to speed up my workflows at work over the past few years. These have worked for years without fail, but all of a sudden several of my key ones have stopped working properly. I am still trying to work out where some of them are failing, but I've identified at least one very strange problem today that I hope someone can help with.

For background, one of my macros obtains a list of the active cases I am working on using Shortcuts and sets a variable to the list. After that, many of my macros start by prompting me with a list from this variable for me to choose which case I want to do something on (be it create a new note or something else). The variable I use for this is "ActiveCaseList". However, all of a sudden, every time I try to set this particular variable to something, it always seems to be empty. I attach a screenshot of a simple two step action that forms part of some of the macros. I first use the "Set Variable" action to (try to) set the variable ActiveCaseList to "Case 1, Case 2, Case 3, Case 4, Case 5". I then use the "Display Text" action to try to display the Variable in a window, but the window shows the variable is always empty...

What is bizarre is that if I try to set any other variables, I can do so. Even if I change one letter (say "ActiveBaseList") it works fine (see the second screenshot). Does anyone have any idea what could have caused this problem all of a sudden? Many thanks.


As it is a Global variable, make sure you haven't any constantly-running macros or external processes that are nuking the value as soon as you reset it (something might have got into an endless loop).

And try deleting the variable via the "Variables" pane in KM's "Settings..." -- select the variable and use the delete button at the bottom of the window rather than editing the variable's contents. You can then recreate it with your test macro, above, and see if it works.

1 Like

Thanks for your reply. It appears that none of my macros that use global variables work anymore unless I change the global variables to something new. I am going to do some further investigating, but at the moment I still have no idea what the cause is.