you can set a global field in a table, and use that field in your script as a dynamic parameter
Thanks for your reply. However, I wonder if using a global field works in a portal. Wouldn't I need one global field for each portal row then?
Not as a global field, but I'd use a global variable for this or even pass the data to the script in a script parameter. You can even pass the names of fields in your script parameter and then use Set Field By Name instead of Set field to modify different fields based on which field name was passed as a script parameter. getField can be used in the same way if you just need to "read" from a different field in order to use that data in a calculation.
If you pass the fieldname in a parameter, you can use this expression in the paramter box: GetFieldName ( yourtable::yourFieldname). That way, if you change the field name later on, this script still passes the correct field name to the script.
Here are some script step examples:
Set Field By Name [ Get ( ScriptParameter ) ; //put your calculation here ]
If [ getField ( Get ( ScriptParameter ) ) = 5 ]
I hadn't used the Get(ScriptParameter) before, but it turned out to be very helpful.
I have tried to use the combination GetField(GetValue(Get(ScriptParameter);2)) and this seems to do what I want.