7 Replies Latest reply on Jan 27, 2009 9:26 AM by antonjazz_1

    GetField() and Set Field By Name



      GetField() and Set Field By Name


      It appears that the Set Field By Name script step expects to be passed

      a field name that includes the table name (e.g. "table::phone"),

      whereas the GetField() function expects to be passed a field name that

      does not include the table name. (e.g. simply "phone").

      Is that correct?


      If so, this seems odd and impractical.


      I'm trying to pass a field name as a parameter to a script, so as to process the field specified by the script parameter.


      Specifically, I want to make a script that removes all spaces and line breaks from a field specified by its parameter.


      But if I pass the full field name, it breaks the GetField() function. My workaround is this (in which I remove the table name and the "::" from the parameter):


      Set Field By Name [Get ( ScriptParameter ); Let ( fieldname = Right(Get(ScriptParameter);Length(Get(ScriptParameter)) -

         Position(Get(ScriptParameter);"::";1;1) - 1 ) ;

       Substitute ( Substitute ( GetField (fieldname) ; "¶" ; "" ) ; " " ; "" )



      Got a more elegant solution?