Setting Dictionary Values

From what I can gather setting Dictionary Values in Shortcuts requires some sort of black magic. As far as I understand the ‘original’ Dictionary doesn’t get updated until you set it to the variable value.

But the Set Variable action does it the other way around? It sets the VARIABLE to the DICTIONARY (which is still empty).

I think I’m getting completely tripped up by all of this. All I’d like to do is to change the value in the Dictionary and have it stay there for the duration of the Shortcut.

Is there perhaps a write-up somewhere that explains all of this please?

I don’t have a writeup but I hope this example might help

Thank you for the example @supermamon, especially for adding the comments. I now realize for the first time what’s going on here - doesn’t make sense to me, but at least it explains what’s going on and why it needs to be done this way. I feel this post of yours should be pinned somewhere :).