What kind of "object" are you getting the content of?
It is a datafield.
Based on the value I need the button to direct to a specific page.
Then you simply need to refer to the field. There's no need to use the function. The mouse click puts the focus into the desired portal row and performs the button's script. The button's script can then refer to any field in the portal table and it will reference the data from the active portal row. Just make sure that no script step such as commit records changes the focus before you access the desired values from that record.
I have been doing this development for a while, I don't know why I went down that complicated row. I feel silly