Hi @big_smile. I agree with all of the excellent information @Zabobon and @Nige_S shared. In this context, I'd like to add a plug for Keyboard Maestro Dictionaries.
As mentioned, global variables are great if you want values to persist from one execution of a macro to another. If your macro has multiple values that need to persist, to avoid global variable clutter, I suggest grouping the values and adding them as separate keys in a single macro dictionary. Dictionaries are effectively global, although unlike global variables, they are not available for browsing in the Keyboard Maestro Preferences. Alternatively, the contents can be viewed by building a simple macro using the KM dictionary actions or by using other macros available on this forum. My personal favorite is @DanThomas' Variable Inspector Prompt and Dictionary Editor.
Dictionaries can seem intimidating initially, let alone applying them as I've suggested above. But with a little practice, you will find them to be very useful for this application and many others. For a simple example, you can check out a macro I've shared elsewhere: Dialog with Dynamic Popup List