I know it is an older topic, but with the introduction of better attended triggers, we have also introduced global variables.
You can learn more about them here:
https://docs.uipath.com/studio/standalone/2023.10/user-guide/overview-trigger-based-attended-automation#global-variables
It is as easy as creating one from the Data Manager panel: