Can I set variable for layer opacity?

Long story short - I would like to set a variable for opacity for conditional logic. I don’t want to hide it (with boolean) as I don’t want to make the impact for space as the element is in auto layout.

I wasn’t able to assign a number nor string.

Can’t currently do that, although I’d enjoy it. But, you could use a component for the thing you want to change, and change the variant (same but with the opacity switch) with a text variable controlled by whatever action you have. It will also maintain its space in the auto layout stack.

change opacity