It is easier NOT to use a variable.
You can bind the server action load to the ID field you want to pass directly by selecting it from the repeat region of the table
We start with a simple table
We add a modal.show() to the Dynamic Click Event of the appropriate cell/ button (as per what you want)
Then in the Show dynamic event we load the server action (previously set to no Auto Load)
(You could also do this alternatively within the click event where you place the modal.show() rather than the modal.show() dynamic event, both work)
and bind it directly to the repeat ID value we want to use
The rest is handled by the Voodoo Magic inside Wappler
No need to use intermediate variables at all, in fact i would definitely say DONT use that method. I used to do it that way and have had issues which caused erroneous results