How can I get a property as a variable?

It all depends on what is containing the widget as it one defining the layout. With canvas widget which is default main root widget when you create Widget Blueprint widget can be freely sized and data contained in slot object inside the widget. So from widget object get “Slot as Canvas Slot” node and from there you can use “Set Size” node.