Data Jar allows storing and retrieving data for usage with Apple's Shortcuts. I'm currently only using it to store a counter, but this will definitely come in handy in other situations.
Available for macOS, iPhone and iPad. And free, but you can leave a tip.