Hello @campaignerforlife,
Yes it's possible.
Here is an exemple.
i've created bellow schema with the below method :

The definition of the method is simple, it just returns a string :

In a form, i trriger the method using a button and store the result of the method in my @string field.
I use a <refresh/> so that the result can be seen on the screen and a <saveView/> so that the change get stored to database
Bellow the definition of my form :

Before clicking the button:

After clicking the button:

Br,
Amine ABEDOUR